Skip to content

Component · 13

Radio

One choice from a few. Built on Base UI: the group is one tab stop and the arrow keys move and select. Round, so it never reads as a checkbox, and it sinks into the page when pressed.

A group

Tab into the group, then use the arrow keys. Name the group with a visible heading.

Plan

tsx
<p id="plan-label">Plan</p>
<RadioGroup aria-labelledby="plan-label" defaultValue="free">
  <Radio value="free" label="Free" />
  <Radio value="pro" label="Pro" />
  <Radio value="team" label="Team" />
</RadioGroup>

Disabled

tsx
<RadioGroup aria-label="Billing" defaultValue="monthly">
  <Radio value="monthly" label="Monthly" />
  <Radio value="yearly" label="Yearly" />
  <Radio value="lifetime" label="Lifetime (sold out)" disabled />
</RadioGroup>

In a form

The chosen value is submitted under the group's name.

tsx
<form>
  <RadioGroup name="size" aria-label="Size" defaultValue="m">
    <Radio value="s" label="Small" />
    <Radio value="m" label="Medium" />
    <Radio value="l" label="Large" />
  </RadioGroup>
</form>

Props

PropTypeDefaultDescription
RadioGroup value / defaultValuestring-The selected value. Controlled with value + onValueChange.
RadioGroup onValueChange(value, details) => void-Fires when the selection changes.
RadioGroup name / required / disabled / readOnly--Form integration. The selected value is submitted under name.
RadioGroup aria-labelledby / aria-labelstringrequiredNames the group. Point it at a visible heading.
Radio valuestringrequiredWhat this option stands for.
Radio labelReactNode-Wraps the radio in a <label> so the text selects it and names it. Without it, pass aria-label.
Radio disabledbooleanfalseVisible but not choosable.
classNamestring-On Radio: with a label it goes on the wrapper, without on the radio.

Use radios when the options are few and all worth seeing. For many options use Select; for several choices at once use Checkbox.