Skip to main content

Autocomplete

Display suggestions as users type, built on Base UI.

View as Markdown

Installation

Component API

PropTypeDefaultDescription
itemsAutocompleteItem[]-
labelstring-
descriptionstring-A line under the input, for what the field expects rather than a restatement of the label.
A line under the input, for what the field expects rather than a restatement of the label.
placeholderstring-Placeholder text.
Placeholder text.
iconReactNode-
iconPositionleading | trailingleadingWhich end icon sits at.
Which end icon sits at.
autoHighlightbooleanfalseHighlights the first match as you type, so Enter takes it without an arrow key first.
Highlights the first match as you type, so Enter takes it without an arrow key first.
limitnumber0
emptyMessagestring-Shown when nothing matches.
Shown when nothing matches.
sizesm | md | lgmd
shapesquare | rounded | squircle | pillrounded
disabledbooleanfalseBlocks interaction and dims the field.
Blocks interaction and dims the field.
loadingbooleanfalse
animatedbooleantrue
focusboolean | stringtrue
containerHTMLElement | null-