115 Components
Split Pane
NavigationA fluid, accessible split pane component supporting horizontal and vertical orientations, pointer-capture dragging, double-click collapse, keyboard navigation, and localStorage persistence.
NewA11y ReadyPointer CapturePersistent
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 />.
| Prop | Type | Default | Description |
|---|---|---|---|
| direction | "horizontal" | "vertical" | "horizontal" | Layout direction of the panes. |
| defaultSize | number | string | "50%" | Initial size of Pane A in pixels (number) or percentage (string). |
| minSize | number | 120 | Minimum allowable size for Pane A in pixels. |
| maxSize | number | string | — | Maximum allowable size for Pane A in pixels or percentage. |
| minSizeB | number | 120 | Minimum allowable size for Pane B in pixels. |
| collapsible | boolean | false | Whether Pane A can collapse on double-click or Enter key. |
| collapsedSize | number | 0 | Size of Pane A when collapsed in pixels. |
| responsiveBreakpoint | number | — | 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. |
| persistKey | string | — | 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.