Select
Picks one value from a list of options.
When to use
- Use when
- Choosing one value from a list of about five to fifteen options.
- Avoid when
- There are only two or three options; use Radio Group. Or many; use Combobox.
Installation
The source lands in src/components/ui/select.tsx, along with any Shelf items it builds on, and .shelf/lock.json records what was installed. It's yours to edit.
Usage
Examples
Groups
Group long lists with labels and separators.
Built on
Verified
- Size
- 2.6 kB gzipped on its own, 46 kB with the Shelf items and packages it builds on. JS and CSS in a production build, without React.
- Accessibility
- Axe passes on 3 stories
- Behavior
- 3 interaction tests in Storybook
- React Doctor
- React Doctor finds nothing