FindBar

fun FindBar(state: FindState, onClose: () -> Unit, modifier: Modifier = Modifier, strings: FindBarStrings = FindBarStrings.Default, requestFocus: Boolean = true, prefillFromSelection: Boolean = true)(source)

A find bar UI component that provides search and replace functionality.

Closing the bar (Escape, the find shortcut, the close button, or the host removing it from the composition) ends the session through FindState.close, clearing the highlights. In either field, F3 and Ctrl+G (Cmd+G on macOS) find the next match, with Shift the previous.

Parameters

state

The FindState managing the search

onClose

Called when the user closes the find bar; the host should hide it

modifier

Modifier for the find bar

strings

Localizable strings for the UI. Defaults to English.

requestFocus

Whether to request focus on the search field when shown

prefillFromSelection

Whether opening the bar over a single-line selection, with no search already running, searches for the selected text