Layout & structure
ISplitter
Resizable panes divided by a draggable handle — a list beside a detail view, an editor above a preview.
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.
const panels = [
{ size: 25, minSize: 15, maxSize: 40 },
{ size: 75 },
]Leave panels off entirely for two panels split evenly.
Vertical
Three panes
A handle goes between panels, so three panels get two handles.
Sizes: —
Collapsing
collapsible lets a panel be dragged shut past its minSize; collapsedSize is what "shut" means, as a percentage. 0 hides it entirely.
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.
<ISplitter auto-save-id="inbox-layout" :panels="panels" />Props
| Prop | Type | Default | Description |
|---|---|---|---|
panels | SplitterPanelOption[] | two even panels | |
direction | 'horizontal' | 'vertical' | 'horizontal' | |
autoSaveId | string | — | Remember the arrangement under this key |
keyboardResizeBy | number | — | Percentage moved per arrow key press |
unstyled | boolean | — | Skip built-in classes |
ui | { root?, panel?, handle?, rule? } | — | Per-slot class overrides |
SplitterPanelOption
| Field | Type | Description |
|---|---|---|
size | number | Starting size, as a percentage |
minSize | number | |
maxSize | number | |
collapsible | boolean | Allow dragging shut past minSize |
collapsedSize | number | What "shut" means, as a percentage |
id | string | Needed when panels are conditionally rendered |
Events
| Event | Payload | Description |
|---|---|---|
layout | number[] | The new sizes, as percentages |
Slots
| Slot | Props | Description |
|---|---|---|
panel-{n} | { panel, index } | Content of the nth panel |
handle | — | Replaces 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.