Skip to content

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.json

Preview

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.json

GitHub 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.json

Usage

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.

PropTypeDefault
valuestring—
defaultValuestring—
onValueChange(value: string) => void—