MeshtasticSearchBar

fun MeshtasticSearchBar(query: String, onQueryChange: (String) -> Unit, placeholder: String, modifier: Modifier = Modifier, clearDescription: String = stringResource(Res.string.clear), resetKey: Any? = Unit, inputFieldTag: String = SEARCH_BAR_INPUT_FIELD_TAG, scrollBehavior: SearchBarScrollBehavior? = null, trailingActions: @Composable RowScope.() -> Unit = {}, expandedContent: @Composable ColumnScope.() -> Unit = {})(source)

The Material 3 search bar every Meshtastic search field is built from: a collapsed SearchBar that expands into a results surface over the screen.

The expanded half follows Material's own rule rather than the caller's: full-screen on compact width, docked on anything wider, because a full-screen dialog over a tablet or desktop window hides context the user was reading.

Parameters

query

the text the field starts with, so a query that survived process death restores into the bar. Later changes to it are ignored; the field is the source of truth once it exists. See resetKey.

onQueryChange

called for every edit made through the field.

placeholder

shown in the empty field, and the field's accessibility name.

resetKey

change this to make the field take query again, for a caller that clears the search from outside.

inputFieldTag

test tag for the collapsed field; the expanded one takes it plus SEARCH_BAR_EXPANDED_TAG_SUFFIX.

scrollBehavior

lets the bar react to the content scrolling under it; see SearchBarDefaults.enterAlwaysSearchBarScrollBehavior.

trailingActions

extra icons after the clear button, for controls that belong to the search itself (a sort menu, a filter menu). They render in the collapsed and expanded field alike.

expandedContent

the results shown under the field once expanded.