Reference

Splitter

A handle that sets the size of a region beside it: dragged, between min: and max:; double-clicked or Enter, back to reset:; the arrow keys move it.

Splitter(bind: State, min: Number, max: Number, …)

Since 5.9.0

min

max

reset

label

Sidebar: 220px

Files

App.wf

Home.wf

Drag the handle, or focus it and use the arrow keys. Double-click puts it back.

Example

wf

state side = 220 Text("Sidebar: {side}px").muted.sm Row { style { height: 180px; border: 1px solid $color-border; border-radius: $radius-md; overflow: hidden } Stack(gap: .xs) { style { width: {side}px; padding: 0.75rem; background: $color-surface } Text("Files").bold Text("App.wf") Text("Home.wf") } Splitter(bind: side, min: 140, max: 400, reset: 220, label: "Sidebar width") Stack { style { flex: 1; padding: 0.75rem } Text("Drag the handle, or focus it and use the arrow keys. Double-click puts it back.") } }

Between a pane and a panel below it

wf

state panel = 120 Stack { style { height: 320px } Container { style { flex: 1 } Text("Editor") } Splitter(bind: panel, min: 80, max: 240, reset: 120, label: "Panel height").horizontal.reverse Container { style { height: {panel}px } Text("Terminal") } }

Props

Props of Splitter
PropTypeUnsetMeaning

bind:

State

A Number of px it reads and writes: the size of the region beside it, which your own style { width: {side}px } applies; without it the handle does nothing

min:

Number

0

The smallest size it writes, in px; Home goes there

max:

Number

none: no limit

The largest size it writes, in px; End goes there

reset:

Number

none

The size a double-click or Enter writes, taken as written (not held to min:): 0 can mean the region's default share. Unset, neither does anything

label:

String

none

The handle's accessible name (aria-label): what it resizes, for a screen reader

horizontal:

Bool

false: a bar between side-by-side regions

A bar between two regions one above the other: it moves up and down, and the arrow keys are Up and Down. Written as a flag, .horizontal, or horizontal: true.

reverse:

Bool

false

It sizes the region after it, not before — a pane on the right, a panel below — so a drag toward the start grows it. Written as a flag, .reverse, or reverse: true.

Attribute families: global, aria, data. Plus the 22 universal props every element takes: animate:, exit:, speed:, duration:, delay:, easing:, stagger:, on:, count:, shared:, class:, ref:, drag:, dragGroup:, dropValue:, dropAxis:, dropInside:, roving:, trapFocus:, mount:, update:, cleanup:.

Flags and cases

A flag is written after the parentheses with a dot: a Bool prop, or a case of one of the element's enum props. A case the enum lacks is an error with a hint.

.horizontal

.reverse

Events

Every element also takes the props, the events and the attribute families listed on every element.

Slots

It takes no slots.

Renders with the class wf-splitter, stable across releases, so a stylesheet may target it.