Radio Group

A radio group component built on Base UI primitives that renders a group of mutually exclusive radio buttons in a vertical grid layout.

Default

Billing cycle

Selected: monthly

Disabled

Entire group disabled

Single item disabled

Form Validation
Horizontal

Size

Color

Selected: slate

With Description

Choose a plan

With Icon

Preview on

Previewing: desktop

Installation

npx shadcn@latest add @byronwade/radio-group

Props

PropTypeDefaultDescription
valueValueThe controlled value of the currently selected radio item.
defaultValueValueThe uncontrolled default selected value on initial render.
onValueChange(value: Value, eventDetails: RadioGroup.ChangeEventDetails) => voidCallback fired when the selected value changes.
disabledbooleanfalseWhether the component should ignore user interaction.
readOnlybooleanfalseWhether the user should be unable to select a different radio button in the group.
requiredbooleanfalseWhether the user must choose a value before submitting a form.
namestringIdentifies the field when a form is submitted.
classNamestringAdditional CSS class names to apply to the group container.