Kwik Search View
A search view that allows users to search for items.
Parameters
Modifier to be applied to the view.
The state of the search view.
The placeholder text to be displayed.
Whether to delay the search or not. Useful for debouncing.
The duration of the delay in milliseconds.
The maximum number of characters allowed in the search field.
Whether the search field has an error or not.
The error message to be displayed.
The callback to be called when the text changes.
The callback to be called when the text is cleared.
The callback to be called when the focus changes.
The callback to be called when the keyboard is done.
Modifier to be applied to the suggestions view.
The callback to be called when a suggestion is selected.
The list of suggestions to be displayed.
The color of the suggestions container.
The colors to be used for the text field.
Example usage:
KwikSearchView(
state = searchQueryState,
onTextChange = {
// handle text change
},
onFocusChanged = { isFocused ->
// handle focus change
},
onKeyboardDone = {
// validate search query and perform search
},
onSuggestionSelected = { suggestion ->
// handle suggestion selection
}
)
This component is a custom search view that allows users to enter a search query and provides suggestions based on the input. It also handles focus changes, keyboard actions, and error states.
KwikSearchView(
state = searchQueryState,
suggestions = listOf("Tortuga", "Isla de Muerta", "Shipwreck Cove", "Davy Jones' Locker"),
onTextChange = {
// handle text change
},
onKeyboardDone = {
// validate search query and perform search
},
onSuggestionSelected = { suggestion ->
// handle suggestion selection
}
)