Radio Group
View on shadcn/uiA set of checkable buttons—known as radio buttons—where no more than one of the buttons can be checked at a time.
Installation
pnpm dlx shadcn@latest add https://designsystem.wfp.org/r/radio-group.jsonUsage
import { Label } from "@/components/ui/label";
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";<RadioGroup defaultValue="option-one">
<div className="flex items-center space-x-2">
<RadioGroupItem value="option-one" id="option-one" />
<Label htmlFor="option-one">Option one</Label>
</div>
<div className="flex items-center space-x-2">
<RadioGroupItem value="option-two" id="option-two" />
<Label htmlFor="option-two">Option two</Label>
</div>
</RadioGroup>