forms · @awesome-ds/react
RadioGroup
Single selection within a named group.
State matrix
selected
unselected
Anatomy
- fieldset
- legend
- radio options
Keyboard contract
Arrow keys move selection within the group; Tab enters and leaves the group.
Screen-reader contract
Legend names the radiogroup and each option exposes checked state.
Content rules
- Options must be mutually exclusive.
- Use concise parallel labels.
Public API
| Prop | Type | required | Description |
|---|---|---|---|
legend | string | required | Group question |
name | string | required | Native radio group name |
options | RadioOption[] | required | Available answers |
value | string | — | Controlled selected value |
onChange | (value: string) => void | — | Selection callback |
Adaptation contracts
- RTL
- Keep label, input, hint, and error aligned to inline-start without changing DOM order.
- High contrast
- Use system field borders, focus indicators, and non-color invalid cues.
- Reduced motion
- Change validation and selection states without sliding or spring motion.
Verification IDs
Live
Live
Copyable example
import { RadioGroup } from "@awesome-ds/react";
<RadioGroup legend="Plan" name="plan" options={[{value:'free',label:'Free'}]} />