Split Panel
Resizable split panes — draggable dividers, horizontal and vertical, nesting, min/max constraints, and layouts that persist.
v0.2.0@magic-spells/split-panel
Live demo
Drag the divider; the nested split inside one pane resizes with it.
About
Resizable split-panel layout web component. Draggable dividers between panels, horizontal or vertical splits, nesting, pixel/percent min/max constraints, keyboard accessibility, and optional localStorage persistence. 3.7 kB JS gzip, 0.7 kB CSS gzip, zero dependencies, no Shadow DOM.
Usage
<split-panel-group> <split-panel size="30" min="200px">Sidebar</split-panel> <split-panel>Main</split-panel> </split-panel-group>
Attributes
| Attribute | Description |
|---|---|
| direction | horizontal (default) — side-by-side columns; vertical — stacked rows |
| disabled | Locks all resizing — divider handles are hidden and stop responding to pointer/keyboard |
| snap | On release, settle the divider to the nearest listed point. Space/comma-separated percentages of the divider's travel (0 = previous panel at its min, 100 = at its max). Bare snap = 0 50 100 |
| id | Opts into localStorage persistence |
About, features, usage and options are taken from the package README.