Radio Group
Picks exactly one option from a short list, all visible at once.
When to use
- Pick exactly one option from two to four, all visible at once.
- A choice where comparing the options side by side helps.
When not to use
- Five or more options: use Select, or Combobox if users search by typing.
- A single yes or no, such as agreeing to terms: use Checkbox.
- Switching views in place: use Toggle Group or Tabs.
Install
npx shadcn@latest add @clinia/radio-groupAnatomy
- 1Radio
data-slot="radio-group-item"border-input · data-checked:bg-primary - 2Dot
data-slot="radio-group-indicator"bg-primary-foreground - 3Label
data-slot="label"text-sm · font-medium
Clinia rules
- The resting circle has an
inputborder (3:1). The selected item is aprimaryfill with aprimary-foregrounddot, never Trust. - Preselect the safest or most common option unless the choice has to be deliberate.
- Options are short, parallel and sentence case:
Every hour,Every day,Every week.
Do and don't
States
unselected / selected
focus
invalid
disabled
Focus cells apply the component's focus-visible classes statically. Toggle the site theme to review both themes.
Accessibility
Built in
- Focus-visible shows a solid Trust ring (
border-ring ring-3 ring-ring/30);aria-invalidswaps it to a destructive ring. - Base UI renders
role="radiogroup"withrole="radio"items. Only the selected item is in the Tab order; the arrow keys move and select.
Your responsibility
- Name the group: wrap it in a
FieldSetwith aFieldLegend, or giveRadioGroupanaria-labeloraria-labelledby. - Give every item a
LabelwithhtmlForset to the item'sid.
How to test
- Press Tab: focus lands on the selected option (or the first one) and the Trust ring appears. Tab again leaves the group.
- Press Arrow Down or Arrow Right: the next option is focused and selected. Arrow Up or Arrow Left goes back.
- With a screen reader, it announces the group name, then the option label, radio button, checked, and its position (2 of 3).
API
Every prop comes from Base UI Radio Group.