Forms
RadioGroup
Single choice between labelled Radio options with roving arrow-key focus.
import { RadioGroup, Radio, RadioInput } from "datui";Playground
<RadioGroup mode="vertical" />Examples
Options
Horizontal
Accessibility
- Radix RadioGroup:
role="radiogroup"; Tab enters at the selected option, arrow keys move focus and select, disabled options are skipped. - Each
Radiorow is a<label>;descriptionis linked witharia-describedby. Label the group witharia-label/aria-labelledby.
API
RadioGroup
Container for `Radio` options (Radix RadioGroup). Tab enters the group at the selected option; arrow keys move focus and select. Give it a label with `aria-label` or `aria-labelledby`.
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | — | |
| defaultValue | string | — | |
| disabled | boolean | — | |
| mode | "horizontal" | "vertical" | vertical | Layout and arrow-key axis. |
| name | string | — | Form field name shared by the options. |
| onValueChange | ((value: string) => void) | — | |
| required | boolean | — | |
| value | string | — |
Radio
Labelled radio row for a `RadioGroup`; the whole row selects.
| Prop | Type | Default | Description |
|---|---|---|---|
| value (required) | string | — | |
| children | ReactNode | — | Label content. |
| className | string | — | |
| description | ReactNode | — | Secondary text, linked through `aria-describedby`. |
| noPadding | boolean | false | |
| titleAfter | ReactNode | — |
RadioInput
Bare radio circle; must be inside a `RadioGroup` and needs an accessible name.
| Prop | Type | Default | Description |
|---|---|---|---|
| value (required) | string | — | |
| className | string | — |