Skip to content

AutoComplete

Autocomplete provides suggestions as users type in a text field. It helps users complete their input faster and reduces errors by offering valid options.

Use autocomplete to help users find and select from a list of options.

Allow users to select multiple options from the autocomplete list.

Show a loading state while fetching autocomplete options.

Provide helpful messaging when no options are available.

Add an action to create new options when none exist.

PropTypeDefaultDescription
optionsAutocompleteOption[][]Collection of options to display
selectedAutocompleteOption[][]Currently selected options
onSelect(selected: AutocompleteOption[]) => voidCallback when selection changes
textFieldTextFieldPropsProps for the text input field
allowMultiplebooleanfalseAllow multiple selections
loadingbooleanfalseShow loading state
willLoadMoreResultsbooleanfalseWhether more results will load
emptyStateEmptyStatePropsEmpty state configuration
actionBeforeActionDescriptorAction to show before options
preferredPosition'above' | 'below' | 'mostSpace''below'Preferred popover position
listboxIdstringID for the listbox
PropTypeDefaultDescription
valuestringUnique value for the option
labelstringDisplay text for the option
disabledbooleanfalseWhether the option is disabled
PropTypeDefaultDescription
valuestringCurrent input value
onChange(value: string) => voidCallback when input changes
labelstringLabel for the input field
placeholderstringPlaceholder text
autoCompletestringHTML autocomplete attribute
disabledbooleanfalseWhether the input is disabled
errorstring | booleanError message or state
helpTextstringHelp text below the input
  • Use autocomplete to help users find options quickly in large datasets
  • Provide clear, descriptive labels for options
  • Show loading states when fetching options asynchronously
  • Implement proper filtering to show relevant results
  • Use empty states to guide users when no results are found
  • Allow creation of new options when appropriate
  • Consider performance with large option lists
  • Provide keyboard navigation support
  • Use multiple selection sparingly and show selected items clearly
  • Autocomplete automatically manages ARIA attributes for screen readers
  • Keyboard navigation is built-in (arrow keys, Enter, Escape)
  • Selected options are announced to assistive technologies
  • Loading states are properly communicated
  • Focus management is handled automatically
  • Use descriptive labels and help text for better context
  • Use Combobox for single-selection dropdowns
  • Use Select for simple option selection
  • Use TextField for basic text input
  • Use Tag to display selected options