Radio group
A set of checkable buttons (radio buttons) where no more than one of the buttons can be checked at a time. Implements the ARIA radio pattern for proper accessibility support.
Full keyboard navigation
Supports horizontal/vertical orientation
Can be controlled or uncontrolled
Architecture
Reference
Root
The root container that manages the state and behavior of the radio group system. Coordinates the interaction between radio items and implements proper ARIA attributes for accessibility support.
Attributes
- aria-labelstring/default: -
Defines an accessible label for the radio group when a visible label is not present.
- aria-labelled-bystring/default: -
References the ID of the element that labels the radio group.
- default-valuestring/default: -
The initial selected value when the radio group is rendered. Use when you do not need to control the selected value.
- directionenum/default: ltr
The reading direction of the radio group. Affects keyboard navigation and visual presentation.
- disabledboolean/default: false
When
true, prevents the user from interacting with the radio group and all its items. - idstring/default: -
ID that is forwarded to the underlying container for DOM manipulation.
- loopboolean/default: true
When
true, keyboard navigation will loop from last item to first and vice versa. - namestring/default: -
The name of the radio group when used within a form. Submitted with its owning form as part of a name/value pair.
- orientationenum/default: vertical
The orientation of the radio group. Affects layout and keyboard navigation behavior.
- requiredboolean/default: false
When
true, indicates that a value must be selected before the owning form can be submitted. - valuestring/default: -
The controlled value of the radio item to check. Must be used in conjunction with
onValueChange.
Events
- onValueChange
Event handler called when the selected value in the radio group changes.
Classes
- direction-rtl
Applied when the reading direction is right-to-left.
- disabled
Applied when the radio group is disabled.
- orientation-horizontal
Applied when the radio group's orientation is horizontal.
Item wrapper
A container component that wraps the radio item. Required for proper layout, accessibility support, and form behavior.
Attributes
- aria-labelstring/default: -
Defines an accessible label for the radio group item when a visible label is not present.
- aria-labelled-bystring/default: -
References the ID of the element that labels the radio item.
- disabledboolean/default: false
When
true, prevents the user from interacting with this specific radio item. - idstring/default: -
ID that is forwarded to the underlying element for DOM manipulation.
- valuestring/default: -
The unique value of the radio item. Used to identify the selected item within the radio group.
Item
The interactive radio button element that can be checked. Implements proper ARIA attributes for accessibility.
Classes
- checked
Applied when the radio item is in a checked state.
- disabled
Applied when the radio item is in a disabled state.
Indicator
Visual indicator that displays when its parent radio item is checked. Can be styled directly or used as a wrapper for an icon.
Classes
- checked
Applied when the parent radio item is in a checked state.
Keyboard
- Space
When focus is on an unchecked radio item, checks it.
When
orientationis vertical, moves focus to the next item in the group and checks it.When
orientationis vertical, moves focus to the previous item in the group and checks it.When
orientationis horizontal, moves focus to the next item and checks it inltror to the previous item inrtl.When
orientationis horizontal, moves focus to the previous item and checks it inltror to the next item inrtl.