Split views with a grip pill that stretches with the pull, squashes at a panel's minimum and morphs into a ball tab when the panel collapses.
DragDrag
Tickets
4 in queue
Export stuck at 90%
T-1042 · Workspace A · updated 4 min ago
The nightly export of the projects table stops at 90% and the download link never appears. It happens on every run since the last schema change.
Steps tried: re-running the export, a smaller date range and another browser. The job log shows no error, only a timeout after ten minutes.
resizable-panels · , lively
resizable-panels-demo.tsx
When to use
Use it for split views where people decide how much room each side gets. Dragging follows the pointer 1:1, keyboard steps and collapse spring, and panels can be collapsible.
When not to use
For a panel that slides over the page instead of sharing it use Drawer. A fixed two-column layout that never changes does not need it.
Use resizable panels for split views in back-office screens: a list beside its detail, an editor
above its results, a canvas beside its inspector. The divider carries a grip pill that grows on
hover, stretches with the speed of the pull, squashes against a panel that reaches its minimum and,
when a panel collapses, morphs into a 24 px ball tab that opens it again. Panels follow the pointer
1:1; collapse, expand and keyboard steps spring to size. For a panel that slides over the page
rather than sharing it, use a drawer.
Panel and PanelHandle are direct children of PanelGroup, a handle between each pair of
panels. Sizes are percentages of the group (handles excluded) and always sum to 100. Give every
panel a defaultSize for a correct server render; defaultLayout or layout set them from the
group. Groups nest: put a PanelGroup with the other direction inside a Panel.
Presets: split (panels flush, a 1 px divider, the grip centred on it), inset (rimmed tiles with
radius 12 and an 8 px gutter, the grip floating in it) and drawer (the last panel collapses to a
ball tab on the edge, starts collapsed below 640 px, and a label pill grows out of the ball on
hover). temperament scales the motion only: at calm the grip grows on hover but does not
stretch or squash, and collapse glides.
-- Seats and revenue per workspace
SELECT workspace, count(*) AS seats,
sum(amount) AS revenue
FROM subscriptions
WHERE status = 'active'
GROUP BY workspace
ORDER BY revenue DESC;
Each PanelHandle is the WAI-ARIA window splitter: a focusable role="separator" with
aria-orientation, aria-valuenow / aria-valuemin / aria-valuemax (the size of the panel
before it, in percent) and aria-controls pointing at that panel. Name it with aria-label.
The hit area is 24 px across for every pointer while the divider stays 1 px; the focus
halo (ring-[3px] ring-ring/50) wraps the grip.
The ball tab is a real 24 px <button> named "Expand " + tabLabel. While a panel is collapsed
its content is inert, so focus never lands inside a hidden panel.
Grip, divider line and chevron are decorative and aria-hidden. Panel content is clipped, never
scaled, so text keeps its size and contrast.
Sizes still change and dragging still follows the pointer. The grip grows on hover without the
pull stretch, the lean or the wall squash; collapse, expand and keyboard steps glide in the short
fade time with no overshoot, and the grip turns into the ball tab in the same fade.
During a drag the sizes are written straight to flex-grow through Motion values: no React render
per panel content, no animation. Collapse, expand and keyboard steps run one Motion value that
drives every panel; the content of the moving panels keeps its width for the trip, so it is
uncovered rather than reflowed each frame. Nothing loops. Heavy panel content (long tables, editors)
is yours to virtualise. autoSaveId reads localStorage once after mount and writes when a drag
or step ends. Third-party: motion.
Technical sheet
Motion
calm
260 ms · bounce 0
lively
400 ms · bounce 0.3
playful
540 ms · bounce 0.45
Main spring of each temperament. Set it with the temperament prop or MotionKitProvider; the default is lively.
Size
Not measured yet · budget 15.0 kB gzip
Component and MotionKit helpers; excludes react, react-dom, motion.
Dependencies
motion · peer
Triggers
drag, click
Reduced motion
Sizes still change and the divider still follows the pointer; the grip grows on hover without stretch or squash, and collapse, expand and keyboard steps glide in the short fade time.
Keyboard
Arrow Left / Right (Up / Down when vertical)
Moves the divider by 2% (Shift: 10%); a collapsed panel expands
Home / End
Panel before the handle to its minimum / maximum
Enter
Collapses the collapsible neighbour (focus moves to its ball tab) or expands it
Enter / Space on the ball tab
Expands the collapsed panel; focus returns to the handle
Browsers
Last 2 versions of Chrome, Edge, Firefox and Safari (iOS 16.4+)