SearchBar
Styled search input with clear button and submit action.
s0 add search-bar
Usage
@State private var query = ""
S0.SearchBar(text: $query)S0.SearchBar(text: $query, placeholder: "Find a recipe…") {
performSearch()
}Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| text | Binding<String> | — | Binding to the search text. |
| placeholder | String | "Search..." | Placeholder text displayed when empty. |
| onSubmit | (() -> Void)? | nil | Closure invoked when the user submits the search. |