RadioGroup
A labelled set of mutually exclusive options.
Signature
Density
Viewport
Theme and light/dark are set in the top barWhen 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
| Prop | Type | Required | Description |
|---|---|---|---|
label | React.ReactNode | — | |
description | string | — | Id of an element that names the group (e.g. a Field label with isGroup). |
value | string | null | — | Controlled selected value. null = controlled with nothing selected (e.g. after a reset); omit (undefined) for uncontrolled. |
defaultValue | string | null | — | |
onChange | (value: string, e: React.ChangeEvent) => void | — | |
name | string | — | |
isDisabled | boolean | — | |
isRequired | boolean | — | Every radio is required: the browser blocks submit until one is chosen. Shows the Required tag. |
isInvalid | boolean | — | Flags the group (aria-invalid) and shows errorMessage, linked via aria-describedby. |
errorMessage | React.ReactNode | — | Shown under the options while isInvalid. |
orientation | "vertical" | "horizontal" | — | "vertical" (default) or "horizontal" — a row that wraps on narrow screens. |
children | React.ReactNode | — | Radio children. |
className | string | — |