Grouped Form
The System Settings layout: titled sections of rounded groups, each row a label and a control.
@cupertinoui/grouped-formRegistry JSON "use client"
import {
GroupedForm,
GroupedFormGroup,
GroupedFormRow,
GroupedFormRowControl,
GroupedFormRowDescription,
GroupedFormRowLabel,
GroupedFormRowTitle,
GroupedFormSection,
GroupedFormSectionTitle,
} from "@/components/ui/grouped-form"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
import { Switch } from "@/components/ui/switch"
export default function GroupedFormDemo() {
return (
<GroupedForm className="w-full max-w-lg rounded-[16px] bg-mac-window px-5 py-4">
<GroupedFormSection>
<GroupedFormSectionTitle>Dock</GroupedFormSectionTitle>
<GroupedFormGroup>
<GroupedFormRow>
<GroupedFormRowTitle>Position on screen</GroupedFormRowTitle>
<GroupedFormRowControl>
<Select defaultValue="bottom" items={{ left: "Left", bottom: "Bottom", right: "Right" }}>
<SelectTrigger variant="borderless">
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="left">Left</SelectItem>
<SelectItem value="bottom">Bottom</SelectItem>
<SelectItem value="right">Right</SelectItem>
</SelectContent>
</Select>
</GroupedFormRowControl>
</GroupedFormRow>
<GroupedFormRow>
<GroupedFormRowTitle>Automatically hide and show the Dock</GroupedFormRowTitle>
<GroupedFormRowControl>
<Switch size="mini" defaultChecked aria-label="Automatically hide and show the Dock" />
</GroupedFormRowControl>
</GroupedFormRow>
<GroupedFormRow className="items-start">
<GroupedFormRowLabel>
<GroupedFormRowTitle>Stage Manager</GroupedFormRowTitle>
<GroupedFormRowDescription>
Arranges your recent windows into a single strip for reduced clutter and quick access.
</GroupedFormRowDescription>
</GroupedFormRowLabel>
<GroupedFormRowControl>
<Switch size="mini" aria-label="Stage Manager" />
</GroupedFormRowControl>
</GroupedFormRow>
</GroupedFormGroup>
</GroupedFormSection>
</GroupedForm>
)
}Installation
pnpm dlx shadcn@latest add @cupertinoui/grouped-formThe first install also adds the macOS theme. See Installation to set up the registry.
Usage
import {
GroupedForm,
GroupedFormGroup,
GroupedFormRow,
GroupedFormRowControl,
GroupedFormRowTitle,
GroupedFormSection,
GroupedFormSectionTitle,
} from "@/components/ui/grouped-form"
<GroupedForm>
<GroupedFormSection>
<GroupedFormSectionTitle>Dock</GroupedFormSectionTitle>
<GroupedFormGroup>
<GroupedFormRow>
<GroupedFormRowTitle>Automatically hide and show the Dock</GroupedFormRowTitle>
<GroupedFormRowControl>
<Switch size="mini" />
</GroupedFormRowControl>
</GroupedFormRow>
</GroupedFormGroup>
</GroupedFormSection>
</GroupedForm>Rows are 36pt tall, or about 37.5pt when they hold a pop-up button, separated by hairlines, as measured in System Settings on macOS 27.
API Reference
Every part forwards the props of the underlying element. The props below are the ones CupertinoUI adds or changes.
GroupedForm
The scrolling content of a settings pane.
| Prop | Type | Description |
|---|---|---|
className | string | Extra classes, merged with the component's own. |
GroupedFormSection / GroupedFormSectionTitle
| Prop | Type | Description |
|---|---|---|
className | string | Extra classes, merged with the component's own. |
GroupedFormGroup
One rounded box of rows.
| Prop | Type | Description |
|---|---|---|
className | string | Extra classes, merged with the component's own. |
GroupedFormRow
| Prop | Type | Description |
|---|---|---|
className | string | Extra classes, merged with the component's own. |
GroupedFormRowLabel / GroupedFormRowTitle / GroupedFormRowDescription
The left side: a title with an optional description.
| Prop | Type | Description |
|---|---|---|
className | string | Extra classes, merged with the component's own. |
GroupedFormRowControl
The right side: switches, pop-ups, checkboxes.
| Prop | Type | Description |
|---|---|---|
className | string | Extra classes, merged with the component's own. |