npx shadcn@latest add https://sdk-components.thesqd.com/r/resizable.jsonimport {
ResizableHandle,
ResizablePanel,
ResizablePanelGroup,
} from "@/components/ui/resizable";import {
ResizableHandle,
ResizablePanel,
ResizablePanelGroup,
} from "@/components/ui/resizable";
export function Example() {
return (
<ResizablePanelGroup orientation="horizontal" className="h-80 rounded-lg border">
<ResizablePanel defaultSize="40%">One</ResizablePanel>
<ResizableHandle withHandle />
<ResizablePanel defaultSize="60%">Two</ResizablePanel>
</ResizablePanelGroup>
);
}ResizablePanelGroup (react-resizable-panels Group; orientation="horizontal | vertical")
├── ResizablePanel (defaultSize / minSize / maxSize / collapsible)
├── ResizableHandle (draggable border between panels)
│ ├── withHandle (grip pill that follows the pointer along the border)
│ └── gripSide (pin the pill to the side being sized: start | end)
└── ResizablePanel
└── ResizablePanelGroup (nest a group inside a panel for split layouts)| Prop | Type | Default | Description |
|---|---|---|---|
orientation | "horizontal" | "vertical" | "horizontal" | Direction panels are laid out and resized in. |
defaultLayout | Layout | — | Initial layout as a map of panel id → percentage. |
onLayoutChange | (layout: Layout) => void | — | Fires while the layout is changing. |
onLayoutChanged | (layout: Layout) => void | — | Fires once a resize finishes — persist the layout here. |
disabled | boolean | false | Disable resizing for every panel and handle in the group. |
| Prop | Type | Default | Description |
|---|---|---|---|
defaultSize | number | string | — | Initial size. Strings like "40%", "240px", "16rem"; bare numbers are pixels. |
minSize | number | string | — | Smallest size the panel can be dragged to. |
maxSize | number | string | — | Largest size the panel can be dragged to. |
collapsible | boolean | false | Let the panel collapse to collapsedSize when dragged below minSize. |
onResize | (size: PanelSize) => void | — | Fires with the panel's new size (percentage and pixels). |
| Prop | Type | Default | Description |
|---|---|---|---|
withHandle | boolean | false | Show a grip pill on hover / drag that tracks the pointer along the border. |
gripSide | "start" | "end" | — | Pin the grip to the side of the panel being sized (start = left/top, end = right/bottom) instead of the side the pointer came from, and lift the handle above the panels. Use it whenever one panel is fixed and the other is the one being sized. |
disabled | boolean | false | Disable dragging this handle. |
disableDoubleClick | boolean | false | Stop double-click from resetting the panel to its default size. |