Skip to content

Splitter

<ax-splitter> lays out resizable panes along one axis. Each <ax-splitter-panel> is sized by a percentage; a draggable gutter sits between adjacent panels. Sizes are kept as percentages that always sum to 100, so the layout is fluid.

import {
AxSplitterComponent,
AxSplitterPanelComponent,
AxSplitterHandleComponent,
} from '@axisui-ng/layout';
<ax-splitter ariaLabel="Editor layout">
<ax-splitter-panel [size]="30" [minSize]="15">Sidebar</ax-splitter-panel>
<ax-splitter-panel [size]="70">Content</ax-splitter-panel>
</ax-splitter>
<!-- vertical -->
<ax-splitter orientation="vertical">
<ax-splitter-panel [size]="60">Editor</ax-splitter-panel>
<ax-splitter-panel [size]="40">Terminal</ax-splitter-panel>
</ax-splitter>
<!-- explicit handles (place your own gutter) -->
<ax-splitter [autoGutters]="false">
<ax-splitter-panel [size]="50">Left</ax-splitter-panel>
<ax-splitter-handle />
<ax-splitter-panel [size]="50">Right</ax-splitter-panel>
</ax-splitter>
InputTypeDefaultNotes
orientation'horizontal' | 'vertical''horizontal'Axis the panels are laid out along.
autoGuttersbooleantruetrue auto-renders a gutter between panels; false → place <ax-splitter-handle> yourself.
gutterSizenumber (px)4Handle thickness.
stepnumber (%)10Arrow-key nudge per press.
storeKeystring''When set, sizes persist to localStorage and restore on load.
ariaLabelstring''Group label, also used on the handles.
sizesmodel<number[]>[]Optional two-way controlled sizes (percentages).
InputTypeDefaultNotes
sizenumber | undefined (%)undefinedInitial size; omitted panels share the remainder equally.
minSizenumber (%)0Lower clamp.
maxSizenumber (%)100Upper clamp.
collapsiblebooleanfalseEnables collapse via double-click / Enter on the gutter.
collapsedSizenumber (%)0Size when collapsed.
InputTypeDefaultNotes
boundarynumber | nullnullBoundary index when a panel renders the handle (auto mode). null → resolve by order among explicit handles.

A collapsible panel toggles between its current size and collapsedSize when you double-click its gutter (or press Enter on the focused handle). Dragging a collapsible panel below its minSize snaps it closed on release. Expanding restores the size the panel had before it collapsed.

A ax-splitter inside a ax-splitter-panel measures its own host, so a vertical splitter nested in a horizontal one (IDE-style layouts) works without extra wiring.

Each gutter is a role="separator" with tabindex="0", aria-orientation (a horizontal splitter has vertical separators), and aria-valuenow/min/max reflecting the leading panel’s percentage and clamp range. Arrow keys resize by step%, Home/End jump to the panel’s min/max, and Enter toggles a collapsible neighbor.

Interactive examples live in Storybook under Layout / Splitter. Run pnpm storybook to explore them.