Components
Resizable
Panels joined by drag handles that let the reader resize them. Use it for split-pane layouts, editors, and any surface where controlling the proportions is useful.
Preview
Rendered with live Cognition tokens. Drag the handle to resize, no dark: classes.
Variants
<ResizablePanelGroup direction="horizontal"><ResizablePanelGroup direction="vertical"><ResizablePanel defaultSize={60}>
<ResizablePanelGroup direction="vertical">…</ResizablePanelGroup>
</ResizablePanel>A horizontal split, a vertical split, and panels nested inside a panel for more complex layouts.
States
Default. A plain handle, no grip.
Dragging. Grab the grip to resize.
Collapsed. A collapsible panel at its collapsedSize.
The handle activates while dragging. A panel marked collapsible can snap to its collapsedSize.
API
Sizes are percentages of the group. Give the ResizablePanelGroup a sized parent so it has room to lay the panels out.
Don't and Do
Don't use Resizable for a layout that should stay fixed. The drag handles tell the reader the proportions are theirs to change, so applying them to a structure you want to hold steady invites edits you did not intend. Use plain layout utilities there.
<ResizablePanelGroup direction="horizontal">
<ResizablePanel defaultSize={30} minSize={20}>
Sidebar
</ResizablePanel>
<ResizableHandle withHandle />
<ResizablePanel defaultSize={70}>Editor</ResizablePanel>
</ResizablePanelGroup>Use it for editor layouts, split views, and any surface where the reader benefits from controlling the proportion of visible content.
import {
ResizableHandle,
ResizablePanel,
ResizablePanelGroup,
} from "@/components/ui/resizable";
export function SplitView() {
return (
<ResizablePanelGroup direction="horizontal" className="h-full">
<ResizablePanel defaultSize={50}>
<div className="flex h-full items-center justify-center p-6">One</div>
</ResizablePanel>
<ResizableHandle withHandle />
<ResizablePanel defaultSize={50}>
<div className="flex h-full items-center justify-center p-6">Two</div>
</ResizablePanel>
</ResizablePanelGroup>
);
}