Radio group
Picks one option out of a few. Arrow keys move the choice, as the platform expects. For a long list, use Select.
Installation
Or with the shadcn CLI, from the registry:
Usage
Tones
tone on the RadioGroup colours every item's checked ring and dot; an item can set its own. Checked, the ring takes the tone's edge, which holds 3:1 against the page: the colour itself, or for warning, whose amber is too light for that, its darker text colour.
Sizes
sm, default and lg on the RadioGroup, at the village's indicator sizes; an item can set its own.
Villages
Round in Konoha and Kiri, square in Iwa (its pill radius is 0); the dot is the nature's primary.
Accessibility
- A
radiogroupofradiobuttons: name the group witharia-label, or with a Field's label. - Tab reaches the checked option; arrow keys move and check the next one.
API reference
The parts of Base UI's Radio Group:
| Part | Notes |
|---|---|
RadioGroup | value, defaultValue, onValueChange, name, disabled, required; tone ("neutral" | "primary" | "success" | "warning" | "info" | "destructive", default "primary") and size ("sm" | "default" | "lg") for every item |
RadioGroupItem | value, disabled; tone and size override the group's |
radioVariants({ tone, size }) returns an item's classes.