Package-level declarations

Functions

Link copied to clipboard
fun TileSchemaBuilderScope.SearchBar(id: String = randomId(), events: EventSchemaBuilderScope.() -> Unit = {}, style: StyleSchemaBuilderScope.() -> Unit = {}, visibility: TileSchema.Visibility = visible(), searchableTerms: List<String>? = null, query: String = "", placeholder: String? = null, leadingIcon: TileSchemaBuilderScope.() -> Unit? = null, trailingIcon: TileSchemaBuilderScope.() -> Unit? = null)

Renders a Material search field showing query, with placeholder shown when empty. The keyboard's IME action is always "Search". leadingIcon is an arbitrary tile rendered in the leading slot. The trailing slot is shared: while query is empty it shows trailingIcon (if any); as soon as query has text it cross-fades to a built-in clear icon button, so a custom trailing icon is never visible at the same time as the clear button. Typing and pressing clear update the query locally on the client (no server round trip needed for the text to change). This is only the input field — it has no expanded state and shows no suggestion list; pair it with e.g. a LazyColumn whose filterChildrenByTerm is driven by the query to render results. Dispatches onQueryChanged (carrying the new text) on every keystroke and also when clear is pressed (with an empty string); onQueryCleared when the clear button is pressed, right before the query-changed trigger; and onSearch (carrying the current query) when the IME "Search" action is pressed.