RadioGroup
Two components: RadioGroup (the container) and Radio (individual options). Built on
React Aria’s RadioGroup and Radio primitives with full keyboard and screen reader support.
Add via CLI
Section titled “Add via CLI”npx @a2ra/cli add radioHorizontal
Section titled “Horizontal”Example JSON
Section titled “Example JSON”{ "type": "RadioGroup", "props": { "label": "Subscription plan", "name": "plan", "defaultValue": "monthly", "orientation": "horizontal" }, "children": [ { "type": "Radio", "props": { "value": "monthly", "label": "Monthly" } }, { "type": "Radio", "props": { "value": "annual", "label": "Annual" } }, { "type": "Radio", "props": { "value": "lifetime", "label": "Lifetime" } } ]}RadioGroup props
Section titled “RadioGroup props”| Prop | Type | Description |
|---|---|---|
label | string | Group label |
value | string | Controlled selected value |
defaultValue | string | Uncontrolled default |
orientation | horizontalvertical default | Layout direction |
isDisabled | truefalse default | Disables all radios |
isRequired | truefalse default | Marks group as required |
isReadOnly | truefalse default | Prevents selection changes |
isInvalid | truefalse default | Shows error styling |
validationBehavior | aria defaultnative | Validation strategy |
name | string | Form field name |
description | string | Helper text |
errorMessage | string | Error text when isInvalid is true |
children | node[] | Radio child nodes |
Radio props
Section titled “Radio props”| Prop | Type | Description |
|---|---|---|
value | string | The value submitted when this radio is selected (required) |
label | string | Visible label text |
isDisabled | truefalse default | Disables just this option |
Radio.valueis required. TheRadioGroupuses it to track and submit the selection.- Arrow keys move focus between options;
Spaceselects the focused option. - Only one
Radioper group can be selected at a time.