Forms

Radio group

Exactly one of a few options, all visible at once.

packages/design-system/components/ui/radio-group.tsx

Examples

Default
Choice cards: a FieldLabel wrapping a Field

Anatomy

  1. 01Group, a grid with gap-3
  2. 02Item, 16px circle
  3. 03Dot indicator when checked
  4. 04Label

Usage

import { RadioGroup, RadioGroupItem } from "@repo/design-system/components/ui/radio-group";

<RadioGroup value={plan} onValueChange={setPlan}>
  <Field orientation="horizontal">
    <RadioGroupItem id="sprint" value="sprint" />
    <FieldLabel htmlFor="sprint">Sprint</FieldLabel>
  </Field>
</RadioGroup>

Props

PropTypeDefaultDescription
value / defaultValuestringnoneThe chosen item's value, on the group.
onValueChange(value, details) => voidnoneCalled with the new value.
RadioGroupItem value*stringnoneWhat the group holds when this item is chosen.
disabledbooleanfalseOn the group or a single item.
classNamestringnoneMerged last with cn(). Use it for layout (width, margin), not to restyle the component.

Guidance

Do

  • Use it for two to five options.
  • Pick a sensible default.

Don't

  • Use it for yes or no. A checkbox or toggle says it quicker.

Where it's used