SearchField
SearchField provides a dedicated search input with a value-first callback, aligned with SwiftUI's searchable input patterns while remaining an explicit web control.
SearchField provides a dedicated search input with a value-first callback, aligned with SwiftUI's searchable input patterns while remaining an explicit web control.
Examples
Examples
Preview unavailable for this example in the static docs build.
Examples
Preview unavailable for this example in the static docs build.
Show code
<SearchField value=""></SearchField>API
| Prop | Type | Required | Description |
|---|---|---|---|
label | string | Yes | Accessible label for the search field. |
value | string | No | Current search text. |
placeholder | string | No | Placeholder text shown when the field is empty. |
onChange | (event: ChangeEvent<HTMLInputElement>) => void | No | Standard change handler for web-style form integrations. |
onValueChange | (value: string) => void | No | Value-first change handler for SwiftUI-style state updates. |
onSubmit | (value: string) => void | No | Called when the user submits the current query with Enter. |
Inherits additional props from Omit<IBaseElementComponent<'input'>, 'children' | 'onChange' | 'onSubmit' | 'type'>.
SearchField provides a dedicated search input with a value-first callback, aligned with SwiftUI's searchable input patterns while remaining an explicit web control.
Status: adapted
SwiftUI Correspondence: Adapted from SwiftUI's searchable text entry patterns into a standalone web control.
Notes
onValueChangesupports SwiftUI-style state updates.onSubmitreceives the current query when the user presses Enter.- Under the hood the component uses a native
input[type="search"].