ui-kit0.0

Display

Resizable panels

Drag the divider to trade space.

Mail client

Three panes you can trade space between. Drag a divider or focus it and use the arrow keys. The first pane is collapsible: press Enter on its divider to fold it away and again to bring it back. The layout is saved under the group’s id, so a reload keeps it.

When to use

  • Workspaces where people balance two or three regions: mail, code editors, file browsers.
  • Panes whose useful size depends on the task, such as a terminal beside code.

Not for a fixed layout (use CSS grid) or for sidebars that only open and close (use a sidebar or sheet).

Vertical

direction="vertical" stacks the panels. withHandle adds a grip that makes the divider easy to find and to hit on touch screens.

// billing/summary.tsx

export function roundCents(amount: number) {

return Math.round(amount * 100) / 100;

}

[14:32:08] Build started for a3f9c21
[14:32:11] Installing dependencies (214 packages)
[14:32:29] Compiled client in 17.2 s
[14:32:31] Compiled server in 1.9 s
[14:32:33] Running 128 unit tests
[14:32:41] All tests passed
[14:32:44] Uploading build output (4.8 MB)
[14:32:52] Deployed to production

API

ResizablePanelGroup

PropTypeDefaultDescription
direction'horizontal' | 'vertical''horizontal'Side by side or stacked.
idstring—Saves sizes in localStorage under this id. Without one nothing is stored. Storage errors are ignored.
onLayout(sizes: number[]) => void—Sizes in % (document order) when a drag or key press ends.

ResizablePanel

PropTypeDefaultDescription
defaultSizenumber—Starting size in % of the group. Panels without one share what is left.
minSize / maxSizenumber0 / 100Limits in %.
collapsiblebooleanfalseDragging below half of minSize snaps it shut; Enter on its handle toggles it.
collapsedSizenumber0Size in % when collapsed.
onResize(size: number) => void—Called when the panel’s size changes.

ResizableHandle

PropTypeDefaultDescription
withHandlebooleanfalseShow a small grip.
aria-labelstring'Resize panels'Accessible name; make it specific when several handles exist.

Give the group a size (h-96); it fills its parent. Panels hide overflow, so put a ScrollArea inside panels that scroll. A ResizableHandle must sit directly between two panels.

Keyboard

KeyAction
← / →Moves a vertical divider by 5% (↑ / ↓ for a horizontal divider in a vertical group).
Home / EndMoves the divider to the start / end limit the panels allow.
EnterCollapses or restores a collapsible neighbour.
TabMoves to the next divider.

Accessibility

  • Each divider is a WAI-ARIA window splitter: role="separator", focusable, aria-orientation, aria-valuenow / min / max (the size of the panel before it, in %) and aria-controls.
  • Dragging uses pointer capture, so it keeps tracking when the pointer leaves the divider, on mouse, touch and pen.
  • Touch targets: the invisible hit area grows from 8px to 24px on coarse pointers.
  • The focused or dragged divider is drawn in the ring colour.

Motion

  • Dragging follows the pointer with no easing.
  • Keyboard collapse and restore glide on the smooth spring.
  • Reduced motion: collapse and restore are instant.