Skip to main content

RadioGroup

A labelled set of mutually exclusive options.

Signature
Density
Viewport
Theme and light/dark are set in the top bar
Live demo
Open ↗

When to use​

A labelled set of mutually exclusive options.

Accessibility​

Always render a visible <label> (the label prop wires htmlFor/id for you). Errors set aria-invalid and are announced via aria-describedby. Required fields expose aria-required.

Install and import​

npx shadcn@latest add @prism/radio-group
import { RadioGroup } from '@/components/prism/RadioGroup';

In a no-build prototype, read it from the bundle instead: const { RadioGroup } = window.PrismDesignSystem_39d121;

Props​

PropTypeRequiredDescription
labelReact.ReactNode—
descriptionstring—Id of an element that names the group (e.g. a Field label with isGroup).
valuestring | null—Controlled selected value. null = controlled with nothing selected (e.g. after a reset); omit (undefined) for uncontrolled.
defaultValuestring | null—
onChange(value: string, e: React.ChangeEvent) =&gt; void—
namestring—
isDisabledboolean—
isRequiredboolean—Every radio is required: the browser blocks submit until one is chosen. Shows the Required tag.
isInvalidboolean—Flags the group (aria-invalid) and shows errorMessage, linked via aria-describedby.
errorMessageReact.ReactNode—Shown under the options while isInvalid.
orientation"vertical" | "horizontal"—"vertical" (default) or "horizontal" — a row that wraps on narrow screens.
childrenReact.ReactNode—Radio children.
classNamestring—