Radio
Radio buttons offer a short list where exactly one option is chosen. Choosing one clears the option chosen before it.
What it is
When to use it
Use radio buttons for two to five options that someone should compare before choosing one.
With more options, or too little room, use a select. When the options change a view or a setting at once and each is a word or two, a segmented control is shorter. When any number may be chosen, use checkboxes. For one setting that is on or off, a checkbox or a switch says it more clearly than two radio buttons.
Anatomy
The circle has the fill and the edge of the checkbox. A description under an option is a full sentence with a full stop: give one to every option in the group, or to none.
- Circle
- 16 px
- --radius-full
- Fill
- white in light, control gray in dark
- Edge
- 1 px, gray in light, faint white in dark
- Chosen
- brand blue fill, no edge
- --brand-blue
- Dot
- 6 px, white
- --on-brand
- Label
- 14 px on a 20 px line
- --text
- Description
- 13 px on an 18 px line
- --text-muted
- Gap to the label
- 8 px
- --space-2
- Space between options
- 8 px with a mouse, none on touch
- --space-2
- Row height on touch
- 44 px
The first choice and the order
Start with one option chosen: the safe and usual answer, placed first. For a first interview that is a video call, which works wherever the candidate lives.
Order the rest from the simplest to the most complex, or from the safest to the riskiest. When choosing nothing is a valid answer, offer it as an option, such as None.
States
- Rest
- Focus
- Chosen
- Disabled
- Error
- Rest
- Focus
- Chosen
- Disabled
- Error
- Focus ring
- 2 px, 2 px outside the circle
- --focus-ring
- Disabled
- the circle at half strength, the label muted
- --text-muted
- Error edge
- 1 px
- --error
Stacked or in a row
Stack options one above the other. Set them in a row only for two or three short labels, and give every option the width of the longest so the circles line up. Below 640 px a row stacks.
- Stacked
- In a row
Keyboard and screen readers
The group is one stop on the Tab ring. A screen reader hears the group label, the option, its place in the group and whether it is chosen.
- Tab
- enters the group at the chosen option, or the first
- Arrow keys
- move to the next or previous option and choose it, wrapping at the ends
- Space
- chooses the focused option when none is chosen
- Shift and Tab
- leaves the group
Writing the labels
Write labels as short fragments in sentence case with no full stop. Let a long label wrap onto a second line rather than cut it with an ellipsis. The group label ends without a colon.