RadioGroup
stableclientradix radio-group
One choice from a short visible set. More than about six options wants a Select.
Default
Anyone can see this board.
Only approved followers.
Nobody, including followers.
<RadioGroup label="Board visibility" defaultValue="public">
<Radio value="public" label="Public" hint="Anyone can see this board." />
<Radio value="private" label="Private" hint="Only approved followers." />
</RadioGroup>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| label* | string | — | Names the set for screen readers. |
| value | string | — | Controlled selection. |
| onValueChange | (value: string) => void | — | Fires on change. |
Guidance
Do
- Always preselect a sensible default — an empty radio group is a dead end.
Don't
- Don't use a radio group for two opposed states; that's a Checkbox or a Switch.
Accessibility
Arrow keys move between options and select as they go — that's the native radio behaviour, preserved.
Tab enters and leaves the group as a single stop.