Easy Shadcn
Components

Radio Group

Radio Group flattens shadcn's RadioGroup into a single items-driven component: each item describes its value, label, and optional description, instead of hand-wiring RadioGroupItem controls and their labels.

Installation

With the @easy-shadcn namespace configured:

pnpm dlx shadcn@latest add @easy-shadcn/radio-group

Or install via the full URL (zero configuration):

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

Props

PropTypeDefaultDescription
itemsRadioGroupItem[]-Option definitions — see the table below. An empty array renders no radios.
valuestring-The selected value. Use for the controlled mode.
defaultValuestring-The initially selected value. Use for the uncontrolled mode.
onValueChange(value: string, eventDetails) => void-Called when the selection changes.
disabledbooleanfalseDisables every option.
requiredbooleanfalseMarks the group as required in a form.
namestring-Field name used on form submission.
optionClassNameClassValue-Class override applied to every option row (the label).
itemClassNameClassValue-Class override applied to every radio control.
labelClassNameClassValue-Class override applied to every label.
descriptionClassNameClassValue-Class override applied to every description.

All other props (className, readOnly, form, etc.) are forwarded to the underlying RadioGroup root.

RadioGroupItem

FieldTypeDescription
valuestringUnique value of the option.
labelReactNodeOption label.
descriptionReactNodeOptional helper text, associated via aria-describedby.
disabledbooleanDisables this option.
optionClassNameClassValuePer-item row class, merged after the root-level optionClassName.
itemClassNameClassValuePer-item control class, merged after the root-level itemClassName.
labelClassNameClassValuePer-item label class, merged after the root-level labelClassName.
descriptionClassNameClassValuePer-item description class, merged after the root-level descriptionClassName.

Notes

  • value / defaultValue / onValueChange are narrowed to string — the Base UI primitive accepts any, which silently swallows typos.
  • Each option is a clickable <label> row; the control is associated with its label and description via aria-labelledby / aria-describedby for correct accessible names.
  • items must be homogeneous. For radio cards with arbitrary content per option or custom indicators, compose the components/ui/radio-group primitives directly instead.

On this page