Stable
Radios let managers pick exactly one option from a short list, with every option visible. Use them for five or fewer options. A group of radios sits in a fieldset with a legend that asks the question, and every radio in the group shares one name.
Atrium uses the browser's own radio, tinted with the accent colour. It has no separate hover style.
Specifications
Anatomy
Anatomy
Size and spacing
Radio group
Pre-select the most common answer if there is a safe default. Otherwise leave all unselected and check one was chosen on save.
Example
States
Unselected
Selected
Focus
Disabled
Example
States
Unselected
Selected
Focus
Disabled
Usage
When to use
- Exactly one choice from five or fewer options.
When not to use
- More than about five options: use a select.
- Several choices: use checkboxes.
- A single on or off option: use a checkbox.
Content
- Order options logically: smallest to largest, or most common first.
- Keep each label short and parallel: "Monthly", "Quarterly", "Yearly".
Do and don't
Do
- Pre-select the most common option when it is safe to.
Don't
- Use a single radio on its own.
Implementation
HTML
<fieldset class="at-fieldset">
<legend>Charge</legend>
<label class="at-choice"><input type="radio" name="charge" checked /> Flat monthly fee</label>
<label class="at-choice"><input type="radio" name="charge" /> Per unit per month</label>
</fieldset>Classes
| Class | What it does |
|---|---|
at-fieldset | Groups the options |
at-choice | One option |
Tokens used
--at-bg-primary
Accessibility
- Give every radio in a group the same name.