Radio Group
Overview
Radio groups present a set of mutually exclusive options, allowing users to select only one option from a predefined list.
They are commonly used in forms, settings panels, and other interfaces where users need to make a single selection from multiple options.
Dos and Don’ts
Anatomy
- Form label (Optional): The form label provides a clear and accessible description of the form element it is associated with.
- Radio input: A radio input indicates the current selected state for the option. By default it is unselected.
- Radio label: Describes the option that can be selected.
- Assistive text (Optional): The assistive text provides additional instructions and error or success messaging for the entire radio group.
Variations
Radio groups can be laid out either vertically or horizontally depending on the use-case and the structure of the user interface. The default layout is vertical, and this is recommended for easier reading.
Vertical
Horizontal
Modifiers
Form label
A form label is recommended to provide the user context of the form element and its content.
Assistive text
Assistive text is used where needed to provide additional information or error / success messaging regarding the whole form element, and never to individual radios. The assistive text is always used for an error state to provide the user with the information required to complete the form element.
Content
All content should use sentence case.
Form label
Label
- Always use clear and concise labels for radio buttons.
- Labels appear to the right of radio buttons.
Overflow
When the label exceeds the available width, the label will wrap onto a new line. Radios with the same row remain top aligned for consistency, and any additional rows underneath move down to accommodate the additional content.
States
Individual radios have their own interactive states: default, hover, active, and focus. However, some states apply to the group as a collective because they affect all radios: error and disabled.
Examples
LTR examples
Here are some examples of the component in a left-to-right context:
RTL examples
Here are some examples of the component in a right-to-left context:
Resources
Stable | |
Stable | |
Alpha | |
Vue [Fozzie] | N/A |
Stable | |
iOS JustUI [UI Kit] | Stable |
iOS PIE [SwiftUI] | Stable |
Android PIE [Compose & Views] | Stable |