Data Display
Forms
Navigation
Frame
A framed container for grouping related information.
Section header
Brief description about the section
Section title
Section description
import {
Frame,
FrameDescription,
FrameFooter,
FrameHeader,
FramePanel,
FrameTitle,
} from "@/components/ui/frame";
export default function Particle() {
return (
<Frame className="w-xl">
<FrameHeader>
<FrameTitle>Section header</FrameTitle>
<FrameDescription>Brief description about the section</FrameDescription>
</FrameHeader>
<FramePanel>
<h2 className="font-semibold text-sm">Section title</h2>
<p className="text-muted-foreground text-sm">Section description</p>
</FramePanel>
<FrameFooter>
<p className="text-muted-foreground text-sm">Footer</p>
</FrameFooter>
</Frame>
);
}
Installation
pnpm dlx cnippet@latest add frame
Usage
import {
Frame,
FrameDescription,
FrameFooter,
FrameHeader,
FramePanel,
FrameTitle,
} from "@/components/ui/frame";<Frame>
<FrameHeader>
<FrameTitle>Title</FrameTitle>
<FrameDescription>Description</FrameDescription>
</FrameHeader>
<FramePanel>Content</FramePanel>
<FrameFooter>Footer</FrameFooter>
</Frame>Examples
Frame within collapsible
import { ChevronDownIcon, TrashIcon } from "lucide-react";
import { Button } from "@/components/ui/button";
import {
Collapsible,
CollapsiblePanel,
CollapsibleTrigger,
} from "@/components/ui/collapsible";
import { Frame, FrameHeader, FramePanel } from "@/components/ui/frame";
export default function Particle() {
return (
<Frame className=" w-xl">
<Collapsible>
<FrameHeader className="flex-row items-center justify-between px-2 py-2">
<CollapsibleTrigger
className="data-panel-open:[&_svg]:rotate-180"
render={<Button variant="ghost" />}
>
<ChevronDownIcon className="size-4" />
Section header
</CollapsibleTrigger>
<Button aria-label="Delete" size="icon" variant="ghost">
<TrashIcon />
</Button>
</FrameHeader>
<CollapsiblePanel>
<FramePanel>
<h2 className="font-semibold text-sm">Section title</h2>
<p className="text-muted-foreground text-sm">Section description</p>
</FramePanel>
</CollapsiblePanel>
</Collapsible>
</Frame>
);
}
Separated Panels
By default, multiple panels are separated with spacing between them.
Section header
Brief description about the section
Separated panel
Section description
Separated panel
Section description
import {
Frame,
FrameDescription,
FrameHeader,
FramePanel,
FrameTitle,
} from "@/components/ui/frame";
export default function Particle() {
return (
<Frame className="w-xl">
<FrameHeader>
<FrameTitle>Section header</FrameTitle>
<FrameDescription>Brief description about the section</FrameDescription>
</FrameHeader>
<FramePanel>
<h2 className="text-sm font-semibold">Separated panel</h2>
<p className="text-muted-foreground text-sm">Section description</p>
</FramePanel>
<FramePanel>
<h2 className="text-sm font-semibold">Separated panel</h2>
<p className="text-muted-foreground text-sm">Section description</p>
</FramePanel>
</Frame>
);
}
Stacked Panels
Use the stackedPanels prop to stack multiple panels together without gaps.
Section header
Brief description about the section
Stacked panel
Section description
Stacked panel
Section description
import {
Frame,
FrameDescription,
FrameHeader,
FramePanel,
FrameTitle,
} from "@/components/ui/frame";
export default function Particle() {
return (
<Frame className="w-xl" stackedPanels>
<FrameHeader>
<FrameTitle>Section header</FrameTitle>
<FrameDescription>Brief description about the section</FrameDescription>
</FrameHeader>
<FramePanel>
<h2 className="text-sm font-semibold">Stacked panel</h2>
<p className="text-muted-foreground text-sm">Section description</p>
</FramePanel>
<FramePanel>
<h2 className="text-sm font-semibold">Stacked panel</h2>
<p className="text-muted-foreground text-sm">Section description</p>
</FramePanel>
</Frame>
);
}