Clinia UI

Radio Group

Picks exactly one option from a short list, all visible at once.

shadcn docs →

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-group
Role

Anatomy

  1. 1Radiodata-slot="radio-group-item"border-input · data-checked:bg-primary
  2. 2Dotdata-slot="radio-group-indicator"bg-primary-foreground
  3. 3Labeldata-slot="label"text-sm · font-medium

Clinia rules

  • The resting circle has an input border (3:1). The selected item is a primary fill with a primary-foreground dot, 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

Do show a few exclusive options, all visible.
Don't use a single radio for a yes or no: use Checkbox.

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-invalid swaps it to a destructive ring.
  • Base UI renders role="radiogroup" with role="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 FieldSet with a FieldLegend, or give RadioGroup an aria-label or aria-labelledby.
  • Give every item a Label with htmlFor set to the item's id.

How to test

  1. Press Tab: focus lands on the selected option (or the first one) and the Trust ring appears. Tab again leaves the group.
  2. Press Arrow Down or Arrow Right: the next option is focused and selected. Arrow Up or Arrow Left goes back.
  3. 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.