FORMS
RadioGroup
Mutually-exclusive radio group built on Radix RadioGroup. Wraps each option in a Memphis-bordered button with a filled inner dot when selected. Use it whenever the user must pick exactly one of three or more options; for two-option toggles reach for SegmentedControl or Switch.
Import
Basic usage
Props
RadioGroup props (props on RadioGroupItem follow the same Radix shape)
| Prop | Type | Default | Description |
|---|---|---|---|
| value | string | — | Controlled selected value. Pair with onValueChange. |
| defaultValue | string | — | Uncontrolled initial selected value. |
| onValueChange | (value: string) => void | — | Fires whenever the selection changes. |
| name | string | — | Name attribute for native form submission. |
| disabled | boolean | — | Disables every item in the group. |
| required | boolean | — | Marks the group as required for native form submission. |
Accessibility
- Radix wires
role="radiogroup"on the root androle="radio"on each item with properaria-checked. - Pair each
RadioGroupItemwith aLabelwired viahtmlForso the click area extends to the label. - Keyboard: Tab moves focus to the currently selected item (roving tabindex); arrow keys cycle items and change the selection; Tab again moves focus out of the group.