Xzero UI
Pro library

Resizable panels

Trade space between panes by dragging the divider between them.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui/resizable-panels
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui/resizable-panels

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { ResizablePanel, ResizablePanels } from "@/components/xzero/resizable-panels/resizable-panels";

export function MailLayout() {
  return (
    <div style={{ height: 480 }}>
      <ResizablePanels label="Mail" onLayoutChange={saveLayout}>
        <ResizablePanel id="folders" label="Folders" defaultSize={22} minSize={160} collapsible>
          <FolderList />
        </ResizablePanel>
        <ResizablePanel id="messages" label="Messages" defaultSize={78}>
          <MessageList />
        </ResizablePanel>
      </ResizablePanels>
    </div>
  );
}

API reference

ResizablePanels

A horizontal split view with draggable, keyboard-operable dividers between panes. Needs a definite height.

PropTypeDefaultDescription
children (required)ReactNode–ResizablePanel elements in order. The set of panes should stay stable.
labelstring–aria-label for the group.
onLayoutChange(sizes: number[]) => void–Called with each pane's share in percent after a resize settles.
classNamestring–Class on the group element.

ResizablePanel

Configuration for one pane. The group renders it.

PropTypeDefaultDescription
id (required)string–Stable id, used by the divider's aria-controls.
label (required)string–Names the pane for its divider.
defaultSize (required)number–Starting share of the group. Shares are relative and need not sum to 100.
minSizenumber80Width in px where the pane starts to resist. Content clips and fades below it.
maxSizenumber–Maximum width in px.
collapsibleboolean–Dragging well past the minimum or flicking toward the edge snaps the pane closed.
defaultCollapsedboolean–Starts collapsed. Requires collapsible.
classNamestring–Class on the pane.
childrenReactNode–Pane content.

Keyboard interactions

KeysAction
ArrowLeft / ArrowRightMoves the focused divider 16px; with Shift, 64px. Past a limit, collapses a collapsible pane.
Home / EndMoves the divider to its minimum or maximum.
EnterCollapses or restores a collapsible neighbouring pane.
EscapeDuring a drag, returns the divider to where it started.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in expand

Guidance for AI tools

Resizable panels: Trade space between panes by dragging the divider between them. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components