Radio Group
A set of checkable buttons where only one can be checked at a time.
When To Use
- When a user needs to select a single option from a list of mutually exclusive choices
- When the number of available options can comfortably fit in the available space
- When immediate feedback or visibility of all options is needed without requiring a dropdown
- When form design clarity benefits from a vertical or horizontal list of visible options
Examples
Basic
A basic radio group with default styling.
With Label
Radio group with form labels for better accessibility.
Select your preferred notification method
We'll send you email notifications about account activity.
We'll send you text messages about account activity.
We'll send you push notifications about account activity.
Disabled
Disabled radio group and individual radio items.
Disabled Radio Group
Individual Disabled Options
Custom
Radio group with custom styling and layout.
Select Theme
Selected theme: Light
Props
RadioGroup
| Prop | Type | Default |
|---|---|---|
onValueChange? | ((value: string) => void) | - |
value? | string | null | - |
loop? | boolean | - |
orientation? | "horizontal" | "vertical" | - |
disabled? | boolean | - |
required? | boolean | - |
name? | string | - |
asChild? | boolean | - |
key? | Key | null | - |
RadioGroupItem
| Prop | Type | Default |
|---|---|---|
required? | boolean | - |
checked? | boolean | - |
asChild? | boolean | - |
value | string | - |
type? | "button" | "submit" | "reset" | - |
formTarget? | string | - |
formNoValidate? | boolean | - |
formMethod? | string | - |
formEncType? | string | - |
formAction? | string | ((formData: FormData) => void | Promise<void>) | - |
disabled? | boolean | - |
key? | Key | null | - |
form? | string | - |
Accessibility
The Radio Group component adheres to the WAI-ARIA Radio Group Pattern.
- The RadioGroup uses
role="radiogroup"and each RadioGroupItem hasrole="radio". - When a RadioGroupItem is checked,
aria-checkedis set totrue. - Radio items are properly labeled using either
aria-labelor associated form labels. - Keyboard users can navigate between options using arrow keys and select options with Space.
- Focus management follows logical tab order and highlights the active option.