Select
A customizable dropdown menu that lets users choose a single option from a predefined list, optimized for accessibility and usability.
Basic
A select component displays a dropdown list of options, allowing users to pick one from the list.
Installation
If you hit any issues, make sure you check out the installation guide here for more information.
Composed Components
When you install this component via the CLI, it automatically loads all composed components, so you don’t need to add them individually.
The Select comes packed with several components to enhance functionality and provide a seamless experience.
Manual Installation
Make sure you also install the composed components and the required packages for the component to function properly.
Anatomy
Select Item Details
If you need to provide more information about an item, use the SelectItemDetails
component to display additional details.
Section
A select component can display items grouped together in sections.
Select with Icon
A select component can display items grouped together in sections.
Validation
If a user submits the form without selecting an item, an error message will appear.
Controlled
You can control the select component by passing the selectedKey
prop.
Uncontrolled
You can uncontrolled the select component by passing the defaultSelectedKey
prop.
Label
When the children
option is a string, Select.Label
will automatically wrap it. However, if the option includes an icon or avatar, you'll need to manually define the wrapper like this:
Disabled
When the select component is disabled, it cannot be interacted with.