Select
- Common Input Field Features
- Dividers
- Disabled Items
- Placeholder
- Empty Selection Item
- Custom Item Label
- Custom Item Presentation
- Best Practices
- Related Components
Select allows users to choose a single value from a list of options presented in an overlay.
The dropdown can be opened with a click, up/down arrow keys, or by typing the initial character for one of the options.
Dividers
Dividers can be used to group related options. Use dividers sparingly to avoid creating unnecessary visual clutter.
Note
|
Use Combo Box for long lists
Please note that for large data sets it is preferable to use Combo Box instead of Select, as it allows users to filter the list of options.
|
Disabled Items
Items can be disabled. This prevents users from selecting them, while still showing that these items would be available for selection under different circumstances.
Caution
|
Accessibility
Some assistive technologies might not announce disabled options.
|
Placeholder
Use the placeholder feature to provide an inline text prompt for the field. Do not create, or use, a separate item for this purpose.
Empty Selection Item
An empty item can be set as the first option.
Use it in cases where you want to allow users to clear their selection.
The value of the empty item is represented as null
.
Custom Item Label
When using complex values, a label can be set to represent the item value as plain text.
When using custom item renderers with rich content, a label can be set to represent the item value when it is selected.
Note
|
Ensure item label generator handles null values
When using Source codeJava
The same applies when using a data source that may contain null values. |
Custom Item Presentation
Items can be rendered with rich content instead of plain text. This can be useful to provide information in a more legible fashion than appending it to the item text.
Best Practices
Do Not Use as a Menu
Select is an input field component, not a generic menu component. Use Menu Bar to create overlays for actions.
Related Components
Component | Usage recommendations |
---|---|
Better accessibility than Select, as all options are visible without user interaction. | |
Filterable list of options. Appropriate for large sets of options. Supports lazy loading entry of custom values. | |
Scrollable inline list of options. Supports single and multi-select. | |
Overlay menus for items that trigger actions. |
86761DF6-1C96-47B2-8311-E777A11405C6