Skip to Content
DocumentationAutocomplete

Autocomplete

A searchable multi-select input that allows users to filter and pick multiple options from a list using checkboxes.

Examples

Default

Disabled

Invalid

This field is required

With Helper Text

Choose an option from the list

API

Root

Contains all the parts of the autocomplete. Manages open/close state and the selected values.

PropertyTypeDefaultDescription
defaultValuesstring[][]The initial selected values when uncontrolled.
valuesstring[]-The controlled selected values. Use with onValuesChange.
onValuesChange(values: string[]) => void-Event handler called when the selected values change.
openboolean-The controlled open state of the dropdown.
onOpenChange(open: boolean) => void-Event handler called when the open state changes.
disabledbooleanfalseWhen true, prevents the user from interacting with the autocomplete.
invalidbooleanfalseWhen true, enables error state styling for the trigger and helper text.

Trigger

The button that toggles the dropdown. Always displays the placeholder text regardless of selection.

PropertyTypeDefaultDescription
placeholderstring”Select an option”The text always displayed in the trigger button.
classNamestring-Additional CSS classes for the trigger button.

Content

The dropdown panel that contains the search input and list of options.

PropertyTypeDefaultDescription
searchPlaceholderstring”Search…”Placeholder text for the search input inside the dropdown.
emptyMessagestring”No results found.”Message displayed when no items match the search query.
classNamestring-Additional CSS classes for the content container.

Item

An individual selectable option inside the dropdown. Displays a checkbox that toggles on selection. The dropdown stays open after selecting an item.

PropertyTypeDefaultDescription
valuestring-The unique identifier of the item, used for selection tracking. Can be an ID. Required.
namestring-Optional display name used for search/filtering. Useful when value is an opaque ID that wouldn’t match user input. When omitted, search matches against value and children text content.
disabledbooleanfalseWhen true, prevents the user from selecting the item.
classNamestring-Additional CSS classes for the item.

Group

Used to group related items inside the content.

PropertyTypeDefaultDescription
headingReactNode-Optional heading label rendered above the group items.
classNamestring-Additional CSS classes for the group container.

Text

Helper text displayed below the trigger. Automatically shows error styling when the root has invalid={true}.

PropertyTypeDefaultDescription
classNamestring-Additional CSS classes for the helper text.
childrenReactNode-The text content. Styled as error text (feedback-error-foreground) when invalid, otherwise normal color (gray-foreground).

ContentFooter

Optional footer rendered at the bottom of the dropdown panel with Cancel and Done action buttons. Place it as a child of AutocompleteContent.

PropertyTypeDefaultDescription
cancelLabelstring”Cancel”Label for the cancel button.
confirmLabelstring”Done”Label for the confirm button.
onCancel() => void-Callback fired when the cancel button is clicked. The dropdown closes automatically.
onConfirm(values: string[]) => void-Callback fired when the confirm button is clicked. Receives the current selected values and closes the dropdown automatically.
classNamestring-Additional CSS classes for the footer container.
Last updated on