SearchInput API
API reference docs for theSearchInput
component. For examples and details on the usage of this component, visit the component demo page.
Props
Prop | Type | Description | Default |
---|---|---|---|
aria-activedescendant? | string | Identifies the currently active element when DOM focus is on the text input. | _ |
aria-autocomplete? | "none" | "inline" | "list" | "both" | Indicates whether inputting text field can show suggested values and how those suggestions appear. | _ |
aria-controls? | string | Identifies the element(s) that the text input controls. | _ |
aria-expanded? | boolean | Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. | _ |
aria-haspopup? | boolean [ "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" ] | Indicates the availability of a popup related to the text input. | _ |
autoComplete? | string | Indicates if autocomplete is enabled for the input field. | _ |
autoCorrect? | 'on' | 'off' | Indicates if auto-correction is turned on for the input. | _ |
autoFocus? | boolean | Automatically sets focus on the input field when it appears | _ |
defaultValue? | string | number | readonly string[] | undefined | The initial value of the text input. | _ |
disabled? | boolean | When true, the input becomes uneditable, makes it read-only, and blocks interaction. | false |
inputMode? | "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | It specifies the type of virtual keyboard to display, helping users enter the correct type of data more easily. | _ |
name? | string | undefined | Identifier for the input, used in form submissions. | _ |
onBlur? | function | A function that executes when the input loses focus. | _ |
onChange? | function | A function that executes when the input's value changes. | _ |
onFocus? | function | A function that triggered when the input receives focus. | _ |
onKeyDown? | function | A function that called when a key is pressed while the input is focused. | _ |
onPaste? | function | A function that executes when content is pasted into the input. | _ |
pattern? | string | Regular expression pattern the input's value must match for validation. | _ |
placeholder? | string | Placeholder text displayed when the input is empty. | _ |
role? | string | ARIA role for the input. | _ |
spellCheck? | boolean | Indicates if the input value should be checked for spelling errors. | _ |
value? | string | number | readonly string[] | undefined | Defines the default or current value of the input field. | _ |
focusContainerRef? | React.Ref<HTMLDivElement> | Reference to the wrapper FocusContainer element. | _ |