All specs
Interactive · split-pane

Split Pane

Side-by-side scrollable layout with tab focus switching.

Anatomy

Source              │ Output
const x = 1        │ > Building…
const y = 2        │ > Done.
export {x, y}      │ ✓ Complete

tab switch pane · ↑↓/jk scroll · ctrl+u/d page · q quit

Usage

await splitPane({
  left:  { title: 'Source', content: sourceCode },
  right: { title: 'Output', content: buildOutput },
  ratio: 0.5,
})

Options

KeyTypeDefaultDescription
left{ title?, content }Left pane
right{ title?, content }Right pane
rationumber?0.5Left pane width ratio (0.2–0.8)
heightnumber?rows − 4Viewport height

### PaneContent

type PaneContent = {
  title?: string
  content: string | string[]
}

Keyboard

KeyAction
tabSwitch focus pane
/ kScroll active pane up
/ jScroll active pane down
Ctrl+UHalf page up
Ctrl+DHalf page down
qQuit
escQuit

Out of scope

Resizable split ratio at runtime

More than 2 panes

Horizontal split (top/bottom)