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.
onQueryChange(value: string) => void-Called with the text as it is typed.
Called with the text as it is typed.
sizesm | md | lgmd
shapenone | rounded | pillrounded
disabledbooleanfalseBlocks interaction and dims the field.
Blocks interaction and dims the field.
loadingbooleanfalse
animatedbooleantrue
classNamestring-
focusboolean | stringtrue
containerHTMLElement | null-