Skip to main content
Urbicon UI

SplitPaneexperimental

Resizable two-pane layout with a draggable divider. The divider is the WAI-ARIA 'window splitter' — focusable, keyboard-resizable, and optionally collapsible. Panes clip their own overflow and scroll independently. Reach for it when both regions are primary content the user should be able to rebalance.

Start pane
End pane
Orientation
Loading...
Loading syntax highlighting...

01 Examples

IDE layout — file tree + editor

The canonical two-pane workspace: a narrow, resizable file tree next to the editor. Each pane clips its own overflow, so long lists and long files scroll independently. Drag the divider or focus it and use the arrow keys; double-click resets to defaultRatio.

// main.ts

import App from './App.svelte';

import './styles.css';

export default new App(options);

Loading...
Loading syntax highlighting...

Vertical split — output over log

Set orientation='vertical' to stack the panes with a horizontal divider. Ideal for a preview or output region above a scrolling console. The arrow-key axis follows the layout: Up/Down resize a vertical split.

Preview

Rendered output goes here. Resize the divider below to give the log more room when you need to read a long stack trace.

✓ build succeeded in 412ms

→ 24 modules transformed

→ dist/index.js 12.4 kB

! 1 unused export in utils.ts

→ watching for changes…

Loading...
Loading syntax highlighting...

Collapsible sidebar with onCollapsedChange

With collapsible, dragging the first pane below collapseThreshold — or pressing Enter on the focused divider — snaps it fully shut with hysteresis, and onCollapsedChange fires on the transition. Track that flag to swap a 'Show panel' affordance in and out.
sidebar visible Drag the divider left, or focus it and press Enter.

Main content. Collapse the sidebar to reclaim its width; re-expand it by pressing Enter on the divider — the previous ratio is restored.

Loading...
Loading syntax highlighting...

Chat beside a live artifact

An AI pattern: the conversation on the left, the generated artifact on the right. Compose SplitPane with the Chat surfaces — see the Chat component for the message list and PromptInput composer that fill the left pane.
Build me a pricing table.
Done — the component is rendering in the panel on the right.
Ask a follow-up…

Artifact preview

Starter

per month

Pro

per month

Team

per month

Loading...
Loading syntax highlighting...

For a permanent navigation rail rather than two rebalanceable content regions, reach for SidebarLayout or Sidebar instead — SplitPane is for when both panes are primary content.

02 Accessibility

The "window splitter" pattern

The divider follows the WAI-ARIA window splitter pattern. It renders as role="separator" made focusable (tabindex="0"), carries aria-controls pointing at the first pane, and exposes its position as aria-valuenow / aria-valuemin / aria-valuemax (percentages, clamped into the configured min/max). Its aria-orientation is the axis of movement — vertical for a horizontal layout, horizontal for a vertical one. Give it a meaningful name via handleLabel (default "Resize panes"). When disabled, the divider drops out of the tab order and reports aria-disabled.

Keyboard

Tab moves focus to the divider. The arrow keys follow the layout axis:

  • / (horizontal) or / (vertical) resize by ±2%.
  • Hold Shift with an arrow for a ±10% step.
  • Home / End jump to the min / max limit.
  • Enter toggles collapse when collapsible is set; otherwise it resets to defaultRatio — the keyboard equivalent of the double-click reset.

Pointer & touch target

Drag uses setPointerCapture, so a resize keeps tracking even if the pointer leaves the divider — no stray window listeners to leak. The divider is a comfortable, full-length hit area along the split axis rather than a hairline, keeping it reachable for touch and coarse pointers. The data-dragging and data-collapsed attributes on the root expose the live state for CSS-only styling.

03 API Reference

21 props
21 props 2 required

No matching properties

No matching properties

04 Installation

Import

Loading...
Loading syntax highlighting...