SearchInput

fun SearchInput(query: String, onValueChange: (String) -> Unit, modifier: Modifier = Modifier, onSearchStarted: () -> Unit = {}, leadingIcon: @Composable RowScope.() -> Unit = { DefaultSearchLeadingIcon() }, label: @Composable () -> Unit = { DefaultSearchLabel() })

The search component that allows the user to fill in a search query and filter their items.

It also holds a clear action, that is active when the search is in focus and not empty, to clear the input.

Parameters

query

Current query value.

onValueChange

Handler when the value changes.

modifier

Modifier for styling.

onSearchStarted

Handler when the search starts, by focusing the input field.

leadingIcon

The icon at the start of the search component that's customizable, but shows DefaultSearchLeadingIcon by default.

label

The label shown in the search component, when there's no input.