Package-level declarations
Find & replace for the Compose Text Editor: the FindBar UI, the FindState holder and its rememberFindState factory, the findShortcut modifier, localizable FindBarStrings, and the match highlight styles.
Types
Localizable strings for the FindBar component. Provide a custom implementation to localize the Find UI.
State management for the Find feature.
Functions
Find all occurrences of a query in the text editor. Matches never span a line break.
Returns the index into matches of the match nearest the cursor.
Intercepts the standard find shortcut (Ctrl+F on Windows, Linux, and Android; Cmd+F on macOS and iOS) and invokes onToggle when triggered. Repeated presses toggle the find bar: onToggle is expected to flip the host's own visibility state.
findShortcut plus find next and previous while state has a query: F3 and Shift+F3, and Ctrl+G and Ctrl+Shift+G (Cmd on macOS and iOS). Without a query those keys pass through.
Creates and remembers a FindState for the given TextEditorState.