Capítulo 27 de 43
A set of mutually-exclusive checkable buttons — the multi-option counterpart to Checkbox, with full roving-tabindex keyboard navigation between options.
Root → Item (per option, → Indicator rendered when checked).loop (default true): whether arrow-key navigation wraps from the last item back to the first.Item renders a hidden native input automatically for form submission.orientation: affects which arrow keys move focus between items (vertical → Up/Down, horizontal → Left/Right).<RadioGroup.Root defaultValue="default" aria-label="View density">
<RadioGroup.Item value="default" id="r1">
<RadioGroup.Indicator />
</RadioGroup.Item>
<label htmlFor="r1">Default</label>
</RadioGroup.Root>
Item with a native label/htmlFor for click-to-select, since Item itself doesn't render a label.| Part | Key props | Key data attributes |
|---|---|---|
Root | value/defaultValue, onValueChange, disabled, name, required, orientation, loop (default true) | [data-disabled] |
Item | value, disabled, required | [data-state] (checked|unchecked), [data-disabled] |
RadioGroup over a set of independent Checkboxes whenever selection is mutually exclusive — you get correct roving-tabindex arrow-key navigation for free.label with each Item (via htmlFor/id or wrapping) — Item provides no text content itself.loop defaults to true, unlike some other Radix collections — disable it explicitly if wrap-around navigation is undesired.