Radio Group
A set of checkable buttons where no more than one of the buttons can be checked at a time.
Loading...
Loading code...
Installation
Usage
import { Label } from "@/components/ui/label"
import { Radio, RadioGroup } from "@/components/ui/radio-group"<RadioGroup defaultValue="next">
<Label>
<Radio value="next" /> Next.js
</Label>
<Label>
<Radio value="vite" /> Vite
</Label>
<Label>
<Radio value="astro" /> Astro
</Label>
</RadioGroup>Examples
For accessible labelling and validation, prefer using the Field component to wrap radio buttons. See the related example: Radio Group field.
Disabled
Loading...
Loading code...
With Description
Loading...
Loading code...
Card Style
Loading...
Loading code...
Form Integration
Loading...
Loading code...
Comparing with Radix / shadcn
If you’re already familiar with Radix UI and shadcn/ui, this guide highlights the small differences and similarities so you can get started with ui/topia quickly.
Quick Checklist
- Use
Radiogoing forward;RadioGroupItemremains for legacy - If you used
asChildon parts, switch to therenderprop