Stable
Checkboxes turn a single option on or off, or let managers pick any number of options from a list. Each checkbox has its own label, and a group of them sits in a fieldset with a legend that asks the question.
Atrium uses the browser's own checkbox, tinted with the accent colour. It has no separate hover style.
Specifications
Anatomy
Anatomy
Size and spacing
Checkbox group
Pick any number of options. Wrap the group in a fieldset with a legend.
Example
States
Unchecked
Checked
Focus
Disabled
Example
States
Unchecked
Checked
Focus
Disabled
Single checkbox
One option on its own, for a yes or no setting. No fieldset is needed.
Example
Example
Usage
When to use
- Choosing any number of options, including none.
- A single yes or no setting that is saved with the form.
When not to use
- Exactly one choice from a list: use radios.
- A setting that takes effect straight away: use a button.
Content
- Labels say what is turned on: "Email", "Include archived properties".
- Avoid negatives such as "Do not send reminders".
- The legend asks the question: "Send reminders by".
Do and don't
Do
- Wrap the input in its label so the text is clickable.
Don't
- Use a checkbox to trigger an action immediately.
Implementation
HTML
<fieldset class="at-fieldset">
<legend>Send reminders by</legend>
<label class="at-choice"><input type="checkbox" checked /> Email</label>
<label class="at-choice"><input type="checkbox" /> SMS</label>
</fieldset>Classes
| Class | What it does |
|---|---|
at-fieldset | Groups related choices |
at-choice | Label wrapping the input and its text |
Tokens used
--at-bg-primary
Accessibility
- Group related checkboxes in a fieldset with a legend.