Skip to content
Drivn logoDrivn

Radio Group

Radio group with dot notation, orientation support, and controlled/uncontrolled selection.

Preview

Installation

npx drivn add radio-group

Usage

1import { RadioGroup } from "@/components/ui/radio-group"
2
3export default function Page() {
4 return (
5 <RadioGroup defaultValue="email">
6 <RadioGroup.Item value="email" label="Email" />
7 <RadioGroup.Item value="sms" label="SMS" />
8 <RadioGroup.Item value="push" label="Push" />
9 </RadioGroup>
10 )
11}

Horizontal

Use orientation for inline radio options.

Square

Rounded square variant for a softer checkbox-like appearance.

With Description

Add secondary text below each label for richer option cards.

Disabled

Disable individual items or the entire group.

API Reference

RadioGroup

PropTypeDefaultDescription
defaultValuestringInitial selected value (uncontrolled)
valuestringSelected value (controlled)
onValueChange(value: string) => voidCallback fired when the selected value changes
orientation"vertical" | "horizontal""vertical"Layout direction of the radio items
variant"circle" | "square""circle"Visual style of the radio indicator
disabledbooleanfalseDisables all radio items in the group
classNamestringAdditional CSS classes for the root element

RadioGroup.Item

PropTypeDefaultDescription
valuestringUnique value for this radio option
labelstringText label displayed next to the radio
descriptionstringSecondary text displayed below the label
childrenReactNodeCustom content (overrides label)
disabledbooleanfalseDisables this specific radio item
classNamestringAdditional CSS classes for the item wrapper
...propsInputHTMLAttributes<HTMLInputElement>All standard HTML input attributes are supported