Intro
Select component
When to Use
Use the select component if:
- Users need to choose one item exclusively from a short list.
- Users don't need to see all options at once, and it's fine for the list to stay hidden until they open it.
Don’t use the select component if:
- Users need to choose between only two options. Use a switch instead.
- Users need to pick one item from a very large set. Use a combobox instead.
- You need to display more than one attribute or allow searching on multiple attributes. In this case, use an input component with a select dialog or value help.
- You need to display all available options right away, without any user interaction. Use radio buttons instead.
Anatomy
Select
- Input field: Displays the selected value.
- Dropdown button: Expands and collapses the dropdown list.
- Selection list: Contains the values users can choose from.
Anatomy of the select component
Dropdown List Item
- Value/Text: Shows the value of the item or the name of the group.
Anatomy of the dropdown list item
Types
The select component doesn't offer multiple types. Only the items in the dropdown list can have different types. You can also combine different dropdown list item variants.
Simple Layout
Selection list with simple layout
Group Header
You can include group headers in dropdown lists to help users scan and understand the options more easily. Group headers are non-interactive; users can't select them as values.
Keep in mind that the select component is designed for small lists of items.
Item as group header
Two-Column Layout
A two-column layout lets you show two values for every selectable item. Each dropdown list item has two columns, and you can adjust their width ratio.
The text in the input field depends on the state of the select component:
A. Enabled state: Only the content of the first column appears in the input field. Users see the second value when they open the dropdown.
B. Read-only state: Both values are displayed in the input field, separated by an en dash. If text is truncated, desktop users can access the full text using a tooltip.
C. Disabled state: Only the content of the first column is shown.
Item with two-column layout
- Keep texts concise and avoid complex content, so you don't overload the component.
- Place the more common or more relevant value in the first column.
Alternative Separator
If the default en dash separator used in the input field in read-only mode is ambiguous or unclear, you can use a vertical line or bullet separator instead.
A. Bullet separator
B. Vertical line separator
For example, if column values include characters that could be mistaken for separators, choosing a different separator can help distinguish between columns.
Read-only input field with alternative separators
Behavior and Interaction
If the select component is editable, users can select an item by clicking the dropdown button and choosing an item from the list.
The component can start with no item selected or with a default value already set, which means one item in the dropdown list appears selected.
Interaction flow when no item is initially selected
Interaction flow starting with a selected item
Responsive Behavior
The input field uses truncation and doesn't wrap text. Users can see the full text by opening the dropdown list or, in read-only mode, by using the tooltip on desktop devices. Items in the dropdown list use either wrapping or truncation.
Truncation and wrapping in edit mode
Width of the Dropdown List
Example: Wider dropdown list with the full texts