Forms
Navigation & layout
Data display & feedback
Date & time
Browse components
← All components
Radio Group
Group of radios with a single selected value.
Install
npx shadcn@latest add https://ui.anuragroy.dev/r/radio-group.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-group.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-group.jsonUsage
Import paths follow your components.json aliases. After install, the default path is @/components/ui/radio-group.
Import
import { RadioGroup } from "@/components/ui/radio-group"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> </RadioGroup> )}API Reference
RadioGroup
Base UI RadioGroup. Value is a string.
| Prop | Type | Default |
|---|---|---|
| value | string | — |
| defaultValue | string | — |
| onValueChange | (value: string) => void | — |