Fieldset
Use Fieldset to give a related set of form fields a shared, visible group name.
Preview
Profile settings group
A profile legend groups a required name field with help and validation text.
Loading preview.
Installation
New to this Registry? Complete the base setup before continuing.
npx shadcn@latest add @neumorphism-ui/fieldsetInstall the shared base once, then add components and their dependencies with the CLI.
Profile settings group
npx shadcn@latest add @neumorphism-ui/field @neumorphism-ui/fieldsetUsage
Place FieldsetLegend first, then compose the individual Field controls beneath it. Keep each field's own label even when the group already has a legend.
"use client";
import { Field, FieldControl, FieldLabel } from "@/components/ui/field";
import { Fieldset, FieldsetLegend } from "@/components/ui/fieldset";
export default function Example() {
return (
<Fieldset>
<FieldsetLegend>Profile settings</FieldsetLegend>
<Field name="displayName">
<FieldLabel>Display name</FieldLabel>
<FieldControl defaultValue="Alex" />
</Field>
</Fieldset>
);
}API Reference
Group related controls under a shared legend and disabled state. Describe the group with FieldsetLegend and retain labels on individual controls.
| Component | Prop | Type | Default | Description |
|---|---|---|---|---|
Fieldset | disabled | boolean | — | Disable user interaction. |
FieldsetLegend | children | React.ReactNode | — | Name the group of related fields. |
Fieldset | className | string | function | — | Extend styling, optionally with a state callback. |
Accessibility
- 01
Describe the group with FieldsetLegend and retain labels on individual controls.
- 02
Preserve labels and visible focus when customizing render or className.