FormsAutocomplete
Autocomplete
Presents a filtered list of options once the user has provided input, for datasets too large to browse.
AutocompleteProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
'aria-describedby' | string | — | — | — |
autoFocus | boolean | — | — | — |
disabled | boolean | — | — | — |
id | string | — | — | — |
invalid | boolean | — | — | — |
loadOptions | (inputValue: string) => Promise<Option[]> | Yes | — | — |
minInputLength | number | — | — | Suggestions are neither requested nor shown until the input holds at least this many characters. Defaults to `0`. |
noOptionsMessage | Props['noOptionsMessage'] | — | — | — |
onBlur | () => void | — | — | Focus left the input, so a form can mark the field touched. |
onChange | (option: Option | null) => void | Yes | — | — |
onInputChange | (inputValue: string) => void | — | — | Reports what the user has typed. Only their own typing is reported, so a caller can treat the input as free text that survives blur and selection. |
placeholder | string | — | — | — |
renderOption | (
option: Option,
meta: FormatOptionLabelMeta<Option>
) => ReactNode | — | — | — |
value | Option | null | — | — | — |