Radio button
Radio button
RadioButton
and RadioButtonGroup
represent a set of mutually exclusive but related options. The user can only select one radio button at a time. When a user selects a new option, the previously selected option automatically clears. Therefore, radio buttons should therefore be used to display a choice between two or more options, as it’s impossible to clear a single radio button after selecting it.
Examples
How to use
Accessibility
- When you have fewer than five options and only single selection is necessary.
- When you have a Boolean selection (on/off). Instead, use
Switch
. - When you have fewer than five options and multiple selection is necessary. Instead, use
CheckboxGroup
. - When you have more than five and fewer than 10 options. Instead, use
Dropdown
. - When you have more than 10 options. Instead, use
ComboBox
.
To import RadioButton
and RadioButtonGroup
from the core Salt package, use:
Name | Type | Description | Default |
---|
Name | Type | Description | Default |
---|
- Checkbox vs. Radio Buttons (https://www.nngroup.com/articles/checkboxes-vs-radio-buttons) NN group, September 26, 2004.
- Radio Button Group pattern (https://www.w3.org/WAI/ARIA/apg/patterns/radio/) W3C