Resizable

Split-pane layout with drag-to-resize handles. Compose ResizablePanelGroup with ResizablePanel children and ResizableHandle between them.

Default

Two-pane horizontal split.

Dark previewReplay previewOpen in new tab
One
Two

Usage

Import the parts you need from the component's folder.

ts
import { ResizablePanelGroup, ResizablePanel, ResizableHandle } from "@/components/ui/resizable";

Vertical

Stack panels with direction="vertical".

Dark previewReplay previewOpen in new tab
Top
Bottom

With handle

Nested groups with visible drag handles via withHandle on each ResizableHandle.

Dark previewReplay previewOpen in new tab
Sidebar
Header
Content

Multiple handles

Three panels split by two visible handles, each with the withHandle grip.

Dark previewReplay previewOpen in new tab
Nav
Main
Aside

API Reference

ResizablePanelGroup

PropTypeDefaultDescription
direction"horizontal" | "vertical""horizontal"Split axis.
autoSaveIdstring—Persist layout to localStorage under this key.
EventDescription
layoutFires with the array of panel sizes whenever the layout changes.

ResizablePanel

PropTypeDefaultDescription
defaultSizenumber—Initial size percentage (0-100).
minSizenumber—Minimum size percentage.
maxSizenumber—Maximum size percentage.
collapsiblebooleanfalseAllow the panel to collapse past minSize.
EventDescription
resizeFires with the new size when this panel is resized.
collapseFires when the panel collapses.
expandFires when the panel expands from a collapsed state.

ResizableHandle

PropTypeDefaultDescription
withHandlebooleanfalseRender a visible drag handle marker.
EventDescription
draggingFires with a boolean as the handle starts and stops dragging.