Stable
Selects let managers choose one option from a list. They save space when there are more than about five options. With five or fewer, radios are better because every option is visible without a click.
Atrium uses the browser's own select, so the dropdown list and its arrow look a little different in each browser and on phones. That is expected.
Specifications
Anatomy
Anatomy
Size and spacing
Select
Put the most common option first, or pre-select it if there is a sensible default.
Example
States
Default
Hover
Focus
Error
Disabled
Example
States
Default
Hover
Focus
Error
Disabled
Usage
When to use
- Choosing one option from more than about five.
When not to use
- Five or fewer options: use radios.
- Choosing several: use checkboxes.
- Hundreds of options: use a text input with search.
Content
- Options in a sensible order: most common first, or alphabetical, or by date.
- Keep option text short so it fits on a phone.
Do and don't
Do
- Keep the native select element.
Don't
- Build a custom dropdown.
Implementation
HTML
<div class="at-field">
<label class="at-label" for="freq">Reminder frequency</label>
<select class="at-select" id="freq">
<option>Weekly</option>
<option>Monthly</option>
<option>Quarterly</option>
</select>
</div>Classes
| Class | What it does |
|---|---|
at-select | Native select, styled |
Tokens used
--at-border, --at-surface, --at-text, --at-border-bold
Accessibility
- Native selects work with keyboards and screen readers out of the box.