Autocomplete
A text input with suggestions; the value is whatever the user types.
When to use
- Use when
- People type free text and suggestions help, such as a search box or a tag input.
- Avoid when
- The value must be one of a fixed list; use Combobox or Select.
Installation
The source lands in src/components/ui/autocomplete.tsx, along with any Shelf items it builds on, and .shelf/lock.json records what was installed. It's yours to edit.
Usage
Built on
Verified
- Size
- 2.6 kB gzipped on its own, 50 kB with the Shelf items and packages it builds on. JS and CSS in a production build, without React.
- Accessibility
- Axe passes on 4 stories
- Behavior
- 4 interaction tests in Storybook
- React Doctor
- React Doctor finds nothing