Radio Group
A set of radio buttons where only one can be selected at a time.
Import
import { RadioGroup, RadioGroupItem } from "@retents/ui/radio-group"Usage Guidelines
When to use
- When users must choose exactly one option from a small set (2–5 options) and all options should be visible.
- For form fields where seeing every choice at once helps users compare and decide.
When NOT to use
- When there are many options (6+) — use Select to save space.
- When multiple selections are allowed — use Checkbox instead.
- For binary on/off toggles — use Switch instead.
Preview
Selected: comfortable
Usage
<RadioGroup defaultValue="comfortable">
<div className="flex items-center gap-2">
<RadioGroupItem value="default" id="r1" />
<Label htmlFor="r1">Default</Label>
</div>
<div className="flex items-center gap-2">
<RadioGroupItem value="comfortable" id="r2" />
<Label htmlFor="r2">Comfortable</Label>
</div>
<div className="flex items-center gap-2">
<RadioGroupItem value="compact" id="r3" />
<Label htmlFor="r3">Compact</Label>
</div>
</RadioGroup>