Radio Group

A set of checkable buttons where only one can be selected at a time, with neumorphic styling.

Installation

$ npx shadcn@latest add "/r/radio.json"

Usage

Sizes

The radio button is available in different sizes.

Disabled

Use the disabled prop to disable the radio button.

Props

Radio

PropTypeDefaultDescription
valuestring-The value of the radio button.
size"sm" | "md" | "lg""md"The size of the radio button.
disabledbooleanfalseWhether the radio button is disabled.
classNamestring-Additional CSS classes to apply to the radio button.

RadioGroup

PropTypeDefaultDescription
defaultValuestring-The value of the radio button that should be checked by default.
valuestring-The controlled value of the checked radio button.
onValueChange(value: string) => void-Event handler called when the checked value changes.
classNamestring-Additional CSS classes to apply to the group.