Forms
Radio group
A set of mutually exclusive options where exactly one must be chosen. Always give the group an accessible name.
Purpose
Use a radio group when the options are few and worth showing at once. Past roughly six options a Select is easier to scan.
Example
States
Disable a single RadioGroupItem when only that option is unavailable, or the whole group via
disabled on the root when the choice cannot be changed at all.
Structure
| Property | Value |
|---|---|
| Control | 20px circle (size-5), 1px --input border, --background fill |
| Indicator | 10px dot (size-2.5) in --primary; checked border --primary |
| Shadow | --shadow-1 |
| Item gap | 8px vertical (gap-2) |
| Focus | 2px --ring, offset 2px |
| Disabled | 50% opacity, not-allowed cursor |
Best practices
Do
- Use it for 2–6 options that deserve to be seen side by side.
- Give the group itself a name — a visible heading or
aria-label. - Pair every item with a
LabelviahtmlFor, so the whole row is clickable. - Pre-select a default when one option is clearly the common case.
Don't
- Use radios for more than about six options — that is a Select.
- Use radios for multi-choice — that is a set of Checkboxes.
- Use a lone radio — once selected it cannot be unselected; a checkbox can.
- Mix disabled and enabled items without saying why the disabled ones are off-limits.
Accessibility & keyboard
- Give the group itself a name with
aria-labelor a visible group label. - Radix renders a
role="radiogroup"with roving focus: the group holds a single Tab stop, on the checked item when there is one. - Disabled items are skipped by keyboard navigation and announced as unavailable.
- Keyboard: arrow keys move between and select options; Tab enters and leaves the group.
Props
RadioGroup is a styled Radix re-export — the root takes value / onValueChange /
defaultValue, plus disabled, name and required for forms; each RadioGroupItem takes its
value and an optional disabled. See the
Storybook prop tables for
the full generated API.