onSubmit | (
(value: string
)) => void | — | Handler that is called when the SearchField is submitted. |
onClear | () => void | — | Handler that is called when the clear button is pressed. |
isDisabled | boolean | — | Whether the input is disabled. |
isReadOnly | boolean | — | Whether the input can be selected but not changed by the user. |
isRequired | boolean | — | Whether user input is required on the input before form submission. |
isInvalid | boolean | — | Whether the input value is invalid. |
validationBehavior | 'aria' | 'native' | 'aria' | Whether to use native HTML form validation to prevent form submission
when the value is missing or invalid, or mark the field as required
or invalid via ARIA. |
validate | (
(value: string
)) => ValidationError
| true
| null
| undefined | — | A function that returns an error message if a given value is invalid.
Validation errors are displayed to the user when the form is submitted
if validationBehavior="native" . For realtime validation, use the isInvalid
prop instead. |
description | ReactNode | — | A description for the field. Provides a hint such as specific requirements for what to choose. |
errorMessage | ReactNode | (
(v: ValidationResult
)) => ReactNode | — | An error message for the field. |
autoFocus | boolean | — | Whether the element should receive focus on render. |
onFocus | (
(e: FocusEvent<Target>
)) => void | — | Handler that is called when the element receives focus. |
onBlur | (
(e: FocusEvent<Target>
)) => void | — | Handler that is called when the element loses focus. |
onFocusChange | (
(isFocused: boolean
)) => void | — | Handler that is called when the element's focus status changes. |
onKeyDown | (
(e: KeyboardEvent
)) => void | — | Handler that is called when a key is pressed. |
onKeyUp | (
(e: KeyboardEvent
)) => void | — | Handler that is called when a key is released. |
placeholder | string | — | Temporary text that occupies the text input when it is empty. |
value | string | — | The current value (controlled). |
defaultValue | string | — | The default value (uncontrolled). |
onChange | (
(value: T
)) => void | — | Handler that is called when the value changes. |
label | ReactNode | — | The content to display as the label. |