Resizable
Resize panels side by side or one above the other by dragging the handle between them or with the keyboard.
- Maya ChenQ3 roadmap review
- Leo ParkInvoice for October
- Ana RuizOnboarding checklist
- Sam OkaforDesign sync notes
Q3 roadmap review
The review moves to Thursday at 10:00. Bring the three goals for your team and the open questions from last week.
Installation
pnpm dlx shadcn@4.18.0 add @siteplane/resizableComplete the one-time setup first. Registry JSON lists source files and dependencies.
For this page’s examples, also install:
pnpm dlx shadcn@4.18.0 add @siteplane/buttonUsage
import {
ResizableHandle,
ResizablePanel,
ResizablePanelGroup,
} from "@/siteplane/components/resizable";
<div className="h-64">
<ResizablePanelGroup>
<ResizablePanel defaultSize="40%">Inbox</ResizablePanel>
<ResizableHandle />
<ResizablePanel defaultSize="60%">Message</ResizablePanel>
</ResizablePanelGroup>
</div>;The group fills its container, so give the container a height. Put a ResizableHandle between every two panels.
Vertical
orientation="vertical" stacks the panels one above the other, and the handle between them is a horizontal line.
Release notes
Teams can now share dashboards with guests. Guests see the dashboard and its comments, and nothing else in the workspace.
Collapsible
A collapsible panel collapses when it is dragged past its minSize, to its collapsedSize (0 by default), and opens again when it is dragged out. With the handle focused, Enter collapses the panel before it and brings it back at its last size. A double click on a handle resets the panel before it to its defaultSize, or the panel after it when only that one has a defaultSize. A panel at 0 px takes its content out of the Tab order and the accessibility tree until it opens again.
Website
Twelve open tasks, three of them due this week.
Sizes
A number sets a size in pixels, defaultSize={200}, and a string without a unit a percentage of the group, defaultSize="30%" or defaultSize="30". rem, em, vh and vw work as strings too. A panel without defaultSize shares the room that the others leave. minSize and maxSize keep a panel between two sizes as the group or the pointer changes it.
Handle
The handle is a line at rest, the hairline that divides two panels of one surface. Under the pointer and while it drags, a soft 3 px band in the muted fill takes its place. Its grab area reaches 8 px across the line under a mouse and 20 px under a finger, and the cursor shows the direction it moves in. With the keyboard focus, the kit's focus ring stands inside the handle, so it reads as one bar along the edge; a press or a drag never shows it. A resizable SidebarRail is the same handle on the edge of a sidebar.
Keyboard
Tab moves to each handle, a separator whose value is the size of the panel before it as a percentage of the group.
| Key | Action |
|---|---|
| ArrowLeft and ArrowRight | Move a handle between panels side by side by 5% of the group |
| ArrowUp and ArrowDown | Move a handle between panels one above the other by 5% |
| Home and End | Move the handle to the smallest and the largest size |
| Enter | Collapse or restore a collapsible panel before the handle |
| F6 and Shift+F6 | Move the focus to the next or the previous handle |
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
Resizable | horizontal | vertical | horizontal | horizontal sets the panels side by side, vertical one above the other. |
Resizable | (layout, meta) => void | unset | Called with the size of every panel, in percent by its id, once a drag ends or a key moves a handle. Save the layout from here. |
Resizable | Record<string, number> | unset | The sizes in percent by panel id that the group starts with, such as a saved layout. |
Resizable | { coarse: number; fine: number } | { coarse: 20, fine: 8 } | The grab area of a handle in px, under a finger and under a mouse or a pen. |
Resizable | number | string | unset | The size it starts with: a number in px, a string without a unit in percent of the group. |
Resizable | number | string | 0% / 100% | The smallest and the largest size a drag or a key gives the panel. |
Resizable | boolean | false | Collapses to collapsedSize past its minSize, and with Enter on the handle after it. |
Resizable | number | string | 0% | The size of the collapsed panel. |
Resizable | string | generated | Names the panel in a layout and in the aria-controls of its handle. Give it one when you save the layout. |
Resizable | string / CSSProperties | unset | Reach the panel's content box, which fills the panel and scrolls content taller or wider than it. |
Resizable | string | Resize panels | The name of the handle, the resizable.handle message by default. Name it after the panel before it, such as Resize inbox, or pass aria-labelledby. |
Resizable | boolean | false | Takes the handle out of the Tab order and stops its drag and its keys. |
Resizable | boolean | false | Leaves the double click without a reset. |
The parts are the Group, Panel and Separator of react-resizable-panels, and their other props, refs and the imperative APIs of usePanelRef and useGroupRef follow it. ResizablePanelGroup carries data-orientation, and a handle carries data-separator, inactive, hover, active while it drags, focus or disabled.
Usage notes
react-resizable-panels sets the page's cursor while the pointer is in a grab area or drags a handle. In a right-to-left page the drag and the arrow keys of a horizontal group still follow the left-to-right direction. For the navigation of an application, use Sidebar with a resizable SidebarRail.