Skip to main content

FormSection

Structure a form into labelled groups (FormSection → <fieldset> + <legend>) with responsive multi-column rows (FormRow).

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

When to use​

Structure a form into labelled groups (FormSection → <fieldset> + <legend>) with responsive multi-column rows (FormRow).

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/form-section
import { FormSection } from '@/components/prism/FormSection';

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

Props​

PropTypeRequiredDescription
titleReact.ReactNode—The section heading, rendered as the fieldset's <legend>.
legendReact.ReactNode—@deprecated Use title. Kept as an alias; removed in 3.0.
descriptionReact.ReactNode—
cardboolean—Wrap the section in a card surface.
size"xs" | "sm" | "md" | "lg"—Heading size, matching SectionHeader: "md" (default) is a page-section heading; "sm" for sections under other headings (the same size as a card title); "xs" a label-style legend for a group nested inside a card (below a card title); "lg" for a form that is the whole page.
measureboolean—Caps the section at a readable width (--form-measure, 40rem) — for a single-column form on a wide page. It still fills a narrower container.
actionsReact.ReactNode—