RadioGroup

A set of checkable buttons—known as radio buttons—where no more than one of the buttons can be checked at a time.

Props

ComponentNotes
RadioGroupPass-through wrapper over Radix RadioGroup.Root with layout classes
RadioGroupItemPass-through wrapper over Radix RadioGroup.Item with styles

All Radix props are supported.

Example

<RadioGroup defaultValue="a">
  <div className="flex items-center gap-3">
    <RadioGroupItem value="a" id="a" />
    <label htmlFor="a">Option A</label>
  </div>
</RadioGroup>

Usage

Group 1:

Group 2:
  <RadioGroup defaultValue="r2">
    <div className="flex items-center gap-3">
      <RadioGroupItem value="r1" id="r1" />
      <label htmlFor="r1">Radio 1</label>
    </div>
    <div className="flex items-center gap-3">
      <RadioGroupItem value="r2" id="r2" />
      <label htmlFor="r2">Radio 2</label>
    </div>
    <div className="flex items-center gap-3">
      <RadioGroupItem value="r3" id="r3" disabled />
      <label htmlFor="r3">Radio 3 disabled</label>
    </div>
  </RadioGroup>
  <RadioGroup defaultValue="r3">
    <div className="flex items-center gap-3">
      <RadioGroupItem value="r1" id="r1" />
      <label htmlFor="r1">Radio 1</label>
    </div>
    <div className="flex items-center gap-3">
      <RadioGroupItem value="r2" id="r2" />
      <label htmlFor="r2">Radio 2</label>
    </div>
    <div className="flex items-center gap-3">
      <RadioGroupItem value="r3" id="r3" disabled />
      <label htmlFor="r3">Radio 3 disabled</label>
    </div>
  </RadioGroup>