formsradio-group
RadioGroup
Single-select radio group with card, list, and table layout variants.
Import#
Slot Structure#
Radiogroup root with mutually exclusive radio items. Use FormField for the group label, description, help text, and validation message.
Examples#
Variants#
List, card, and table variants for single selection.
Sizes + Orientation#
Size scale and vertical/horizontal modes.
Controlled + Disabled#
Controlled value with disabled option in data set.
Indicator Positions#
Start/end/hidden indicator styles with card variant.
API Reference#
Attributes#
Slot
root5 attributesRadio group container that owns selection state and layout.
ARIA Attributes
| ARIA Attribute | Description |
|---|---|
| aria-disabled | Indicates that the control is disabled. |
| aria-orientation | Communicates horizontal or vertical orientation. |
| aria-readonly | Indicates that the control value cannot be changed by the user. |
| aria-required | Indicates that user input is required. |
| role | Defines the semantic role exposed to assistive technology. |
Props#
| Prop | Type | Default | Description |
|---|---|---|---|
| class | ClassValue | — | Class applied to the component root or trigger element. |
| classes | RadioGroupT.Classes | undefined | — | — |
| defaultValue | string | undefined | — | The default value of the input (uncontrolled). |
| disabled | boolean | undefined | false | Whether the input is disabled. |
| id | string | undefined | — | The ID of the input element. |
| indicator | RadioGroupItemIndicator | undefined | — | — |
| items | (string | RadioGroupT.Item)[] | undefined | — | Array of items to render in the group. |
| name | string | undefined | — | The name of the input element, used for form submission. |
| onChange | ((value: string) => void) | undefined | — | Callback when the selected value changes. |
| orientation | "horizontal" | "vertical" | undefined | vertical | The orientation of the radio group. |
| readOnly | boolean | undefined | false | Whether the input is read-only. |
| ref | JSX.HTMLElementTags["div"] extends { ref?: infer Ref; } ? Ref : never | undefined | — | — |
| required | boolean | undefined | false | Whether the input is required. |
| size | "xs" | "sm" | "md" | "lg" | "xl" | undefined | — | — |
| style | JSX.CSSProperties | undefined | — | — |
| styles | RadioGroupT.Styles | undefined | — | — |
| value | string | undefined | — | The current value of the input (controlled). |
| variant | RadioGroupItemVariant | undefined | — | — |
Items#
A radio item object.
| Prop | Type | Default | Description |
|---|---|---|---|
| description | JSX.Element | — | Description for the radio item. |
| disabled | boolean | undefined | — | Whether the item is disabled. |
| label | JSX.Element | — | Label for the radio item. |
| value | string | undefined | — | Value of the radio item. |