Installation
npx shadcn@latest add @iconiq/b-autocompleteReducedMotion
Pass reducedMotionwhen you want the installed component to settle into its quieter motion path immediately. Leaving the prop unset still respects the user's system-level reduced motion preference.
Props
Autocomplete
12 props
Root autocomplete controller. Compose AutocompleteInput, AutocompleteContent, AutocompleteList, and AutocompleteItem inside it.
items
readonly Item[]Item collection used for list filtering. Pass a flat array or grouped items for sectioned results.
value
stringControlled input text shown in the field.
defaultValue
stringInitial input text for uncontrolled usage.
onValueChange
(value: string) => voidCalled when the input text changes from typing or when a suggestion is accepted.
itemToStringValue
(item: Item) => stringMaps each item to the string used for filtering and the committed input value.
mode
"list" | "both" | "inline" | "none"Default
"list"Controls filtering and inline completion while navigating suggestions.
autoHighlight
boolean | "always"Default
trueAutomatically highlights the first matching item while typing.
open
booleanControlled popup state. Pair with onOpenChange.
onOpenChange
(open: boolean, eventDetails) => voidCalled when the suggestion panel opens or closes. Use with open for controlled popup state.
openOnInputClick
booleanDefault
falseWhen true, clicking the input opens the suggestion panel even before typing.
isItemEqualToValue
(item: Item, value: Item) => booleanCustom equality for object items. Use when items are recreated on each render.
reducedMotion
booleanForces the Iconiq motion layer into reduced-motion mode.
Notes
Built on Base UI Autocomplete with list filtering, keyboard navigation, and a sliding highlight treatment.
Radix UI does not ship a dedicated autocomplete primitive, so this install is Base UI only.
Pass value and onValueChange for controlled input text. The popup opens while typing by default, not on focus.
Object items require itemToStringValue. Use isItemEqualToValue if selection highlight behaves incorrectly.
AutocompleteInput
4 props
Styled input shell with border, focus ring, and optional clear control. The suggestion panel opens while typing, not on focus or click.
placeholder
stringShown when the input is empty.
showClear
booleanDefault
trueControls whether AutocompleteClear is rendered.
showTrigger
booleanDefault
falseWhen true, renders a chevron trigger that toggles the suggestion panel.
disabled
booleanDefault
falseDisables the input and clear button.
AutocompleteContent
2 props
Portaled suggestion panel with a subtle fade-slide entrance and anchored width.
side
"top" | "right" | "bottom" | "left"Default
"bottom"Preferred side for the popup.
sideOffset
numberDefault
6Distance between the input and the popup.
AutocompleteItem
2 props
Suggestion row with optional description and a spring-driven highlight fill.
value
ItemRequired
Item value passed to Base UI for selection handling.
description
ReactNodeOptional secondary line below the primary label.