Forms
Radio group
Choose one option from a visible set.
Basic
Native radios that share one name. The group is a single tab stop; arrow keys move the selection, exactly as in the browser.
When to use
- Choosing exactly one option from two to about six, where seeing all options helps the decision.
- Options that need a short description, such as delivery speed or a billing period.
Not for: more than about six options (use a select), or independent yes/no choices (use checkboxes).
Horizontal
orientation="horizontal" lays the options in a row that wraps on narrow screens. Individual items can be disabled.
You save 20% with yearly billing.
Radio cards
variant="card" makes each option a card. One selection ring is measured to the checked card and glides between them on the morph spring.
Selected: Pro
API
RadioGroup
| Prop | Type | Default | Description |
|---|---|---|---|
| value | string | — | Controlled value. |
| defaultValue | string | — | Initial value when uncontrolled. |
| onValueChange | (value: string) => void | — | Called when the selection changes. |
| name | string | — | Shared name of the native radios (generated if omitted). |
| orientation | 'vertical' | 'horizontal' | 'vertical' | Layout direction. |
| variant | 'default' | 'card' | 'default' | Card shows bordered options with a gliding ring. |
| size | 'sm' | 'md' | 'lg' | 'md' | Circle size: 16 / 20 / 24px. |
| disabled / required / invalid | boolean | — | Applied to every item. |
| ...props | HTMLAttributes<HTMLDivElement> | — | Forwarded to the group, including aria-label. |
RadioGroupItem
| Prop | Type | Default | Description |
|---|---|---|---|
| value | string | — | Required. The value this option represents. |
| label | ReactNode | — | Visible label. Without one, pass aria-label. |
| description | ReactNode | — | Secondary text; wired with aria-describedby. |
| disabled | boolean | — | Skips this option for focus and selection. |
| ...props | InputHTMLAttributes | — | Forwarded to the <input type="radio">, including ref. |
Keyboard
| Key | Action |
|---|---|
| Tab | Moves focus into the group (to the selected option, or the first) and out again. |
| ↓ / → | Selects and focuses the next option, wrapping at the end. |
| ↑ / ← | Selects and focuses the previous option, wrapping at the start. |
| Space | Selects the focused option if it is not already selected. |
Accessibility
- role="radiogroup" around native radios: roving tab stop, arrow keys and “2 of 3” announcements come from the browser.
- Give the group an aria-label or aria-labelledby; each item has its own label.
- Disabled items are skipped by arrow keys. Invalid sets aria-invalid on every radio.
- Keyboard focus shows a 3px ring on the circle (or around the card).
Motion
- The dot scales in on the snappy spring; the circle fills with the control colour.
- Cards: the selection ring is one element, translated and resized to the checked card with the morph spring (550ms). It is placed without animation on first paint and on resize.
- Reduced motion: the ring jumps to the new card; colours still change.