- style
Radio Button
- 1 Description
- 2 Usage & Behavior
- 2.1 General guidelines
- 2.1.1 Structure
- 2.2 States
- 2.3 Interaction
- 2.4 Validations and errors
- 2.5 Best practices
- 2.1 General guidelines
- 3 Accessibility compliance
- 3.1 Focus management
- 4 Design
- 5 Code
Description
Radio buttons are used when a list of two or more options are mutually exclusive, meaning the user must select only one option.
Usage & Behavior
Use radio buttons to select a single option from a list, while exposing all available options.
General guidelines
Only one option can be selected in a group of radio buttons.
One option must always be selected.
Structure
A radio button consists of:
A label describing the option
A corresponding radio button
States
State | Unselected | Selected |
---|---|---|
Regular | ||
Hover | ||
Active | ||
Disabled | ||
Read-Only | ||
Focused | ||
Focused Hover | ||
Focused Active | ||
Focused Disabled |
Interaction
The user clicks a radio button to select the related option. This deselects the previously-selected option.
Clicking an option which is already selected does not deselect it, but clicking a different option transfers the selection to that option.
The radio can be selected by clicking on either the button or the label.
The radio will have a hover state when hovering over either the button or the label.
The radio will have an active state during the action of clicking either the button or the label.
Validations and errors
Please refer to Field Validation page for more information.
Best practices
Use:
to select a single option from a list, while exposing all available options
Do not Use:
where there is a need to allow the user to make multiple selections → use Checkboxes, because radio buttons only allow single-selection.
where there is a need to present more than 8 options → use a Drop-down Menu.
where the default option is recommended for most users in most situations. Consider a Drop-down Menu instead, which uses less space by not immediately showing all options.
where there are only two mutually exclusive options. Combine them into a single Checkbox or Switch. For example, use a checkbox for “I agree” (e.g. to terms and conditions) instead of two radio buttons for “I agree” and “I don’t agree”.
where the options are numbers with fixed steps → use a Slider.
General
List options in a logical order:
Most likely to least likely to be selected.
Simplest to most complex operation.
Make the most likely or convenient radio button option the default.
If no default exists, or unselected state is required, include a None option.
If you can't have a comprehensive list of all possible options, include an additional Other option.
Try to avoid:
putting things in alphabetical order, because it is language dependent and not localizable.
overlapping choices, e.g. Select age: 0-20, 20-40. What do you select if your age is 20?
forgetting to include choices. e.g. Select age: Below 20, Above 20 - What do you select if you are exactly 20?
Accessibility compliance
Unless otherwise specified, see our general compliance information in Fundamentals - Accessibility.
Focus management
Keyboard | Description |
---|---|
Tab | Navigates to the next component. |
Shift + Tab | Navigates to the previous component. |
Space | N/A |
Enter | N/A |
Esc | N/A |
Arrows | Up/Left - Navigates to and selects the previous item. Down/Right - Navigates to and selects the next item. |
A group of radio buttons behaves like a single control. Only the selected choice is accessible using the tab key, but users can then cycle through the individual options using the arrow keys.
Design
Zeplin link | Screen thumbnail |
---|---|
|
Code