
- Location:
sabo/src/components/ui/radio-group.tsx
When to use
- Let users select exactly one option from a short list (2-5 items work best).
Usage
Key props
string
Initial or controlled value for the group.
(value: string) => void
Change handler for controlled usage.
string
Unique value that identifies the item in the group.
This component forwards all props from Radix Radio Group primitives (Root/Item). Above are commonly used props. For the full API, see Radix docs: https://www.radix-ui.com/primitives/docs/components/radio-group
Styling tip
Wrap each item with a label for proper hit area.Accessibility
- Each radio item must have an associated label for screen readers.
- Use
defaultValueorvalueto ensure one option is always selected. - Keyboard navigation (arrow keys) is handled automatically.