Stylish Search Bar
A search bar with a collapsed input field and an expanded results panel, wrapping the Material 3 SearchBar with Stylish defaults.
Hoist query and active to the caller. While active is true, the bar expands and shows content (typically a list of suggestions) below the input field. onSearch fires when the user commits a query via the IME search action; onActiveChange fires when the bar is expanded or collapsed.
Parameters
Current text of the search query.
Called with the new text as the user types.
Called with the committed query when the user presses the search action on the keyboard.
Whether the search bar is expanded and showing search results.
Called when the expanded state should change.
Modifier applied to the SearchBar root.
Optional icon shown at the start of the input field, typically a search icon.
Optional icon shown at the end of the input field, e.g. a clear button.
Corner shape of the collapsed search bar. Defaults to RoundedCornerShape with StylishTheme.dimensions.connectedCornerRadius.
SearchBarColors for the bar. Defaults to SearchBarDefaults.colors with a MaterialTheme.colorScheme.surfaceContainerHigh container.