Skip to content

Layout & structure

ISplitter

Resizable panes divided by a draggable handle — a list beside a detail view, an editor above a preview.

List
Detail

Panels come from the panels prop and their content from numbered slots — #panel-0, #panel-1, and so on. The splitter fills its container, so give that container a height.

Sizes

Every size is a percentage of the group. size is where a panel starts, minSize and maxSize are how far it can be dragged.

ts
const panels = [
  { size: 25, minSize: 15, maxSize: 40 },
  { size: 75 },
]

Leave panels off entirely for two panels split evenly.

Vertical

Editor
Output

Three panes

A handle goes between panels, so three panels get two handles.

Nav
Main
Inspector

Sizes: —

Collapsing

collapsible lets a panel be dragged shut past its minSize; collapsedSize is what "shut" means, as a percentage. 0 hides it entirely.

ts
const panels = [
  { size: 25, minSize: 15, collapsible: true, collapsedSize: 0 },
  { size: 75 },
]

Remembering the arrangement

Give auto-save-id a stable key and the layout is stored in localStorage, surviving a reload.

vue
<ISplitter auto-save-id="inbox-layout" :panels="panels" />

Props

PropTypeDefaultDescription
panelsSplitterPanelOption[]two even panels
direction'horizontal' | 'vertical''horizontal'
autoSaveIdstringRemember the arrangement under this key
keyboardResizeBynumberPercentage moved per arrow key press
unstyledbooleanSkip built-in classes
ui{ root?, panel?, handle?, rule? }Per-slot class overrides

SplitterPanelOption

FieldTypeDescription
sizenumberStarting size, as a percentage
minSizenumber
maxSizenumber
collapsiblebooleanAllow dragging shut past minSize
collapsedSizenumberWhat "shut" means, as a percentage
idstringNeeded when panels are conditionally rendered

Events

EventPayloadDescription
layoutnumber[]The new sizes, as percentages

Slots

SlotPropsDescription
panel-{n}{ panel, index }Content of the nth panel
handleReplaces the handle's rule

Accessibility

The handle is a focusable separator, reachable by Tab and moved with the arrow keys; keyboardResizeBy sets how far each press goes. Its hit area is padded well beyond the visible rule.