Forms
Navigation & layout
Data display & feedback
Date & time
Browse components
← All components
Radio
Single radio control. Pair with RadioGroup.
Install
npx shadcn@latest add https://ui.anuragroy.dev/r/radio.jsonPreview
Loading preview…
Installation
Add the component from this site. The shadcn CLI fetches the registry JSON over HTTPS — no named registry submission required.
Terminal
npx shadcn@latest add https://ui.anuragroy.dev/r/radio.jsonGitHub fallback if the website is down:
Terminal
npx shadcn@latest add https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/radio.jsonUsage
Import paths follow your components.json aliases. After install, the default path is @/components/ui/radio.
Import
import { Radio } from "@/components/ui/radio"example.tsx
import { Radio } from "@/components/ui/radio"import { RadioGroup } from "@/components/ui/radio-group"export function Example() { return ( <RadioGroup defaultValue="a" className="flex flex-col gap-2"> <label className="flex items-center gap-2 text-sm"> <Radio value="a" /> Option A </label> <label className="flex items-center gap-2 text-sm"> <Radio value="b" /> Option B </label> </RadioGroup> )}API Reference
Radio
Base UI Radio. Requires `value` and a parent `RadioGroup`.
| Prop | Type | Default |
|---|---|---|
| value | string | — |