Radio buttons allow users to see all available choices and select exactly one.
When to use the radio button component
- Single selection. When users need to select only one option out of a set of mutually exclusive choices.
- Limited choices. When the number of available options can fit onto a mobile screen.
When to consider something else
- Multiple selections. Consider checkboxes if users need to select more than one option or if there is only one item to select.
- Limited space. Consider a dropdown if you don’t have enough space to list out all available options.
- Selecting none. If users should be able to select zero of the options.
- Use the label as a target. Users should be able to tap on or click on either the text “label” or the radio button to select or deselect an option.
- List items vertically. Options that are listed vertically are easier to read than those that are listed horizontally. Horizontal listings can make it difficult to tell which label pertains to which radio button.
- Use adequate spacing. If you customize, make sure selections are adequately spaced for touch screens.
- Set default values with caution. Setting a default value can discourage users from making conscious decisions, seem pushy, or alienate users who don’t fit into your assumptions. If you are unsure, leave nothing selected by default.
- Customize accessibly. If you customize the radio buttons, ensure they continue to meet the the accessibility requirements that apply to all form controls.
- Use fieldset and legend. Group related radio buttons together with
<fieldset>and describe the group with
- Use proper labels and attributes. Each radio button should have a
<label>. Associate the two by matching the
forattribute to the
titleattribute can replace