Client component

Splitter

A two-panel split with a draggable divider. The handle is a real role="separator" with the APG window-splitter keyboard contract (arrows step the split, Home/End jump to the limits), and dragging uses pointer capture, so fast drags never lose the handle.

Sidebar

Content: drag the divider, or focus it and use arrow keys

Import#

import { Splitter } from "astralis-ui";

How sizing works#

The first panel's share rides a CSS variable on the root; panels are addressed by DOM order (Panel / Handle / Panel), so there is no registration protocol. The second panel takes the rest.

Props#

PropTypeDefaultDescription
orientation"horizontal" | "vertical""horizontal"Split axis. horizontal puts the panels side by side.
size · defaultSize · onResizenumber · number · (size: number) => voidNone · 50 · NoneControlled / initial share of the first panel, in percent, and the change callback.
minSizenumber10Smallest share the first panel can shrink to, in percent.
maxSizenumber90Largest share the first panel can grow to, in percent.

Parts#

PropTypeDefaultDescription
Splitter.Paneldiv propsNoneOne of the two panes, addressed by DOM order. The second takes the remaining space.
Splitter.Handlediv propsNoneThe draggable divider between the panels. Give it an aria-label.

Keyboard#

The handle is a single tab stop. With it focused:

KeyAction
← / →Shrink / grow the first panel by 2% (horizontal)
↑ / ↓Shrink / grow the first panel by 2% (vertical)
HomeShrink the first panel to minSize
EndGrow the first panel to maxSize

Accessibility#

The handle renders role="separator" with aria-valuenow, aria-valuemin and aria-valuemax, so assistive technology announces the split as a percentage. Label it with aria-label ("Resize sidebar").