Hextech UI

Autocomplete

Live example

Autocomplete

Installation

Terminal
npx shadcn@latest add https://hextech-ui.vercel.app/r/autocomplete.json

API reference

These are the main Autocomplete options. See the exported TypeScript types for inherited native or primitive props.

PropTypeDefault
labelstring (required)—
optionsreadonly T[]required
value / defaultValuestring—
onValueChange(text, details) => void—
getOptionKey / itemToStringValuesuggestion identity and text gettersid/value + label
modelist | both | inline | nonelist
renderOption / isOptionDisabledrenderer / predicate—
clearOnEscapeboolean; closed Escape clears only when enabledfalse

Text and options

Autocomplete owns free text; it is not a selected-record Combobox. Use value and onValueChange for controlled editing. Give object options stable keys and string values. Use Combobox when choosing a record rather than completing text.