Jenga Search Field
A search input: a JengaTextField with a leading search icon and a clear button that appears once there's text. While the query is empty, the trailingContent slot (e.g. a scan button) takes the clear button's place.
Parameters
the current query.
called when the query changes.
hint shown when empty (e.g. "Search tickets").
accessibility label for the clear button.
the Modifier for this field.
whether the field is editable.
called when the clear button is tapped; defaults to clearing the text.
optional end slot shown while the query is empty.
optional slot below the field (e.g. a hint).
the field shape; defaults to the theme's search field style, else JengaSearchFieldDefaults.shape.
the color set; defaults to the theme's search field style, else JengaTextFieldDefaults.colors.
the query and placeholder text style.
the minimum height of the field.
padding inside the field.
software-keyboard configuration (e.g. a number pad, the Search key).
IME action handlers (e.g. run the search when Search is pressed).
Samples
var query by remember {
mutableStateOf(
value = "",
)
}
JengaSearchField(
value = query,
onValueChange = { query = it },
placeholder = "Search tickets",
clearContentDescription = "Clear search",
)