Skip to main content

Field

The label / description / error scaffold for controls that don't bake it in (Select, custom inputs, radio groups).

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

When to use​

The label / description / error scaffold for controls that don't bake it in (Select, custom inputs, radio groups).

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/field
import { Field } from '@/components/prism/Field';

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

Props​

PropTypeRequiredDescription
labelReact.ReactNode—
descriptionReact.ReactNode—
errorMessageReact.ReactNode—
isRequiredboolean—
isInvalidboolean—
isGroupboolean—The child is a group (checkboxes, a radio set, a ComboBox), so a <label htmlFor> would point at nothing. The label becomes a <span> with an id; a render-function child gets "aria-labelledby", and a plain child is wrapped in a named role="group".
hintReact.ReactNode—Right-aligned secondary note in the label row (e.g. "Optional").
idstring—
htmlForstring—
classNamestring—
childrenReact.ReactNode | ((aria: FieldAria) =&gt; React.ReactNode)—