datui
Color scheme

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 Radio row is a <label>; description is linked with aria-describedby. Label the group with aria-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`.

PropTypeDefaultDescription
classNamestring—
defaultValuestring—
disabledboolean—
mode"horizontal" | "vertical"verticalLayout and arrow-key axis.
namestring—Form field name shared by the options.
onValueChange((value: string) => void)—
requiredboolean—
valuestring—

Radio

Labelled radio row for a `RadioGroup`; the whole row selects.

PropTypeDefaultDescription
value (required)string—
childrenReactNode—Label content.
classNamestring—
descriptionReactNode—Secondary text, linked through `aria-describedby`.
noPaddingbooleanfalse
titleAfterReactNode—

RadioInput

Bare radio circle; must be inside a `RadioGroup` and needs an accessible name.

PropTypeDefaultDescription
value (required)string—
classNamestring—