Splitter

Resize two real panes, with accepted state rather than pointer proposals driving layout.

Sidebar · pixels

Editor · percent

Preview

Proposed: noneAccepted request: 180pxLast accepted commit: noneCommits: 0Collapsed: false
() => <Card style={{ width: "100%" }}><SplitterDemo /></Card>

The outer sidebar uses pixels; the nested vertical editor uses percentages. Each Root has primary Panel, Handle and secondary Panel in that order. Nested roots register independently. Both panels have bounds; percentages use space remaining after the handle and gaps. If the available width cannot satisfy both minima, the layout visibly overflows and the handle becomes unavailable rather than violating bounds.

Focus Workspace sidebar and press an arrow. Proposed records requests; Accepted request records parent state; Last accepted commit records effective accepted geometry. Turn off Accept resize proposals: the proposed number can change without the panel moving or incrementing commits. Resize the container: measurement alone must not commit.

Enter collapses/restores without changing the retained expanded size or commit count. Refuse collapse to keep layout and focus unchanged. The external button demonstrates application-owned collapse state. Primary descendants remain mounted but hidden/inert while collapsed; if focus was inside, it evacuates to Handle, not a hidden descendant. Focus already outside is not stolen.

The separator has a 24-pixel track, an explicit name, visible focus and forced-colors treatment. Touch suppression is limited to handles, leaving editor/panel scrolling native. RTL reverses physical horizontal resizing while preserving logical primary identity. Keyboard Shift multiplies the step; Home/End use constrained bounds. Pointer cancellation preserves accepted live changes but does not commit them.

See complete API, SSR/measurement boundaries and three standalone downloads. This recipe requires the published Primitives 0.1.0-rc.4 release candidate, not historical rc.2; use the exact-version npm installation instructions. This is a two-pane primitive, not an N-pane layout or persistence engine.