Radio buttons
Use radio buttons when people must choose exactly one option from a group. Compare standard and tiled styles.
Examples
Default
Breakpoints
Mobile
320pxMobile Lg
480pxTablet
640pxDesktop
1024pxradio-buttons-demo.tsx
Tiled
Breakpoints
Mobile
320pxMobile Lg
480pxTablet
640pxDesktop
1024pxradio-buttons-tiled-demo.tsx
Component API
Put Item parts inside Root, with ItemInput, ItemControl, ItemLabel, and optional ItemDescription inside each item.
Root<div>
Owns the selected radio value.
| Prop | Type | Description |
|---|---|---|
name | string | Form field name. |
disabled | boolean | Disables the group. |
readOnly | boolean | Sets aria-readonly on the group. Native radio inputs remain operable. |
invalid | boolean | Marks the group invalid. |
onValueChange | (value: string) => void | Receives the selected value. |
tile | boolean | Uses the tiled item treatment. |
Item<label>
Connects ItemInput, ItemControl, and ItemLabel for one choice.
| Prop | Type | Description |
|---|---|---|
value | string (required) | Value for this choice. |
ItemInput<input>
Native radio control. Pass disabled for an individual choice and defaultChecked for an initial selection.
ItemControl<div>
Displays the custom selection mark.
ItemLabel<div>
Displays the option text.
ItemDescription<div>
Displays optional help text.