Command Palette

Search for a command to run...

Radio Group

A set of checkable buttons — known as radio buttons — where only one button can be checked at a time.

Installation

pnpm dlx shadcn@latest add https://dga-registry.vercel.app/r/radio-group.json

Basic Radio Group

Simple radio groups with default, disabled, and individual disabled item states.

Radio Group with Descriptions

Radio options with additional descriptive text.

Unprocessed measurements as recorded by sensors

Average values calculated for each hour

Average values calculated for each day

Average values calculated for each week

Controlled Radio Group

Radio group with controlled state and value display.

Horizontal Layout

Radio groups displayed in a horizontal row.

Card Style Radio Group

Radio options styled as cards for better visual hierarchy.

Form Examples

Real-world form scenarios using radio groups.

Data Query Form

Include all measurements regardless of quality flags

Only include quality-checked and validated measurements

Alert Settings

Receive alerts as soon as thresholds are exceeded

Receive a summary of alerts once per hour

Receive a daily summary of all alerts

Grid Layout

Radio groups displayed in a grid for better space utilization.

Props

RadioGroup

PropTypeDefaultDescription
defaultValuestringThe default selected value
valuestringControlled selected value
onValueChange(value: string) => voidCallback when value changes
disabledbooleanfalseDisables the entire group
classNamestringAdditional CSS classes

RadioGroupItem

PropTypeDefaultDescription
valuestringThe value of the radio item
disabledbooleanfalseDisables this specific item
idstringHTML id for label association
classNamestringAdditional CSS classes