Skip to content
esc

RadioGroup

Inputshadcn/ui

Picks exactly one of 2 to 5 options that the user should see side by side.

When to use

  • Preselect a sensible default.
  • For rich options (plan, delivery speed), wrap each item and its text in a Card-like row that is clickable.
  • Don't use it for more than 5 options; use Select.
  • Don't use it for on/off; use Switch or Checkbox.

Accessibility

Role
radiogroup
Keyboard
Arrow keys move and select. Tab enters and leaves the group.
Notes
Give the group a name with aria-label or a visible heading linked by aria-labelledby.

Props

  • value / onValueChange

    string / (value: string) => void

    Controlled value on RadioGroup.

  • defaultValue

    string

    Preselect the safest or most common option.

Prompt for your agent

Use the UnbuiltUI RadioGroup. Call unbuilt_get_component("RadioGroup") first and follow its spec: variants, states, usage rules and accessibility.

unbuilt_get_component returns

0 variants6 states2 props4 usage rules3 a11y notes7 tokens1 example

Add it with shadcn

$npx shadcn add https://unbuiltui.com/r/radio-group.json

Tokens · 7

bg.raisedbg.inversefg.inversefg.mutedborder.defaultborder.focusdanger.default