Autocomplete
A text field that suggests as you type. The text is the value, and a suggestion only fills it in.
Examples
Default
Click the field to see recent searches, then type: the list moves to the height of what still matches, and the matched part of each suggestion is bold.
With the chevron
An AutocompleteTrigger at the end of the field opens the suggestions that match its text, so an empty field shows them all.
From a server
Set filter to null and pass the results as items. The list says it is looking from the first key, and a spinner joins once the search lasts: in the list while it is empty, in the field while older results still show. AutocompleteStatus tells a screen reader how many it found.
In a form
In a Field, its label names the input and an invalid field marks it, with the error under it.
Installation
npx shadcn@latest add https://kinoui.com/r/autocomplete.json- Files
lib/reduce-motion.tslib/scroll.tslib/refs.tslib/resize.tslib/swap.tsxlib/popup.tslib/glide.tsxcomponents/kino/tooltip.tsxlib/cut.tsxcomponents/kino/spinner.tsxcomponents/kino/button.tsxcomponents/kino/input.tsxcomponents/kino/separator.tsxlib/run-progress.tslib/highlight.tslib/menu.tsxcomponents/kino/select.tsxlib/filter-list.tsxcomponents/kino/autocomplete.tsx- Packages
@base-ui/reactclass-variance-authority- Global CSS
- the feels, the density tokens, the shape tokens and the success and warning colours
New to Kino? Installation covers what your project needs first and the @kino namespace.
API reference
Autocomplete
AutocompleteContent
Accessibility
- The input is a combobox and the list a listbox: arrow keys move the highlight, Enter puts the highlighted suggestion in the field, and Escape closes the list.
- Escape on a closed list clears the text, as the WAI-ARIA pattern allows.
- Name it with a
Fieldand its label, oraria-labelon the input. - The matched part of a suggestion is bold, not only coloured.
- When the system asks for less motion, the list changes height at once and only fades.