Skip to content

Autocomplete

Displays a searchable list of options.

Installation

Anatomy

Usage

Controlled

Control the selected value with value and onValueChange props.

Selected: banana

States

Invalid

Disabled

Sizes

Small

Medium

Large

Examples

Group

With Field

Use Field components to style with the field components.

We'll use this for shipping estimates

With clear button

Pass showClear to AutocompleteInput to show a clear button.

With trigger

Pass showTrigger to AutocompleteInput to show the dropdown trigger button.

With start icon

Use InputGroupAddon to add a start icon to the input.

API Reference

Autocomplete

Root component.

AutocompleteInput

Input with dropdown trigger and clear button.

AutocompleteContent

Holds the dropdown options. Displayed in a portal.

AutocompleteGroup

Groups related items. Use with groupBy on the collection.

AutocompleteGroupLabel

Label for a group of options. Use inside AutocompleteGroup.

AutocompleteItem

Single selectable option in the dropdown list.

AutocompleteEmpty

Shown when no options match the current filter. Use for empty state.


For a complete list of props, see the Ark UI documentation.