115 Components

Split Pane

Navigation

A fluid, accessible split pane component supporting horizontal and vertical orientations, pointer-capture dragging, double-click collapse, keyboard navigation, and localStorage persistence.

NewA11y ReadyPointer CapturePersistent
/r/split-pane.json
Explorer

Double-click the divider or press Enter to collapse.

Pane A • Left
Editor Buffer

Drag the divider to resize fluidly. Arrow keys also work with keyboard focus.

Pane B • Flex 1

Installation

Install directly into your project using the shadcn CLI or copy the source code manually.

Requires:framer-motionclsxtailwind-merge
$npx shadcn@latest add "https://boseui.site/r/split-pane.json"

Props

TypeScript props supported by <SplitPane />.

11 props
PropTypeDefaultDescription
direction"horizontal" | "vertical""horizontal"Layout direction of the panes.
defaultSizenumber | string"50%"Initial size of Pane A in pixels (number) or percentage (string).
minSizenumber120Minimum allowable size for Pane A in pixels.
maxSizenumber | string—Maximum allowable size for Pane A in pixels or percentage.
minSizeBnumber120Minimum allowable size for Pane B in pixels.
collapsiblebooleanfalseWhether Pane A can collapse on double-click or Enter key.
collapsedSizenumber0Size of Pane A when collapsed in pixels.
responsiveBreakpointnumber—Screen width in pixels below which layout collapses into vertical stack.
onResize(size: number) => void—Callback fired continuously during dragging with new pixel size.
onResizeEnd(size: number) => void—Callback fired when the drag operation completes.
persistKeystring—LocalStorage key to save and restore pane sizes across reloads.

Key Features

  • Supports both horizontal (columns) and vertical (rows) splitting directions.
  • Hardware-accelerated pointer capture resizing with touch, mouse, and pen support.
  • Full-screen transparent drag overlay preventing iframe or text-selection interruptions.
  • Double-click divider or press Enter to collapse or expand with smooth 200ms ease-out transitions.
  • Instant 0ms latency during dragging with zero layout shift.
  • Automatic percentage scaling when container resizes.
  • Responsive breakpoint switching from horizontal to stacked vertical on mobile screens.
  • LocalStorage persistence key support to remember pane sizes across visits.
  • Full nesting support for complex multi-split IDE or dashboard layouts.

Keyboard & Accessibility

  • Divider uses role='separator' with dynamic aria-orientation, aria-valuenow, aria-valuemin, and aria-valuemax.
  • Keyboard accessible with Tab focus: Arrow keys resize by 10px (Shift for 50px increments).
  • Home and End keys jump immediately to minSize and maxSize.
  • Enter key toggles collapsible state.
  • High-contrast visible focus ring on the divider.