Searching Open Sourcery

Type to search Open Sourcery.

Overlays & Panels

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

$ npm i @magic-spells/split-panel

GitHubnpm

Live demo

SidebarEditorConsole

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

AttributeDescription
directionhorizontal (default) — side-by-side columns; vertical — stacked rows
disabledLocks all resizing — divider handles are hidden and stop responding to pointer/keyboard
snapOn 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
idOpts into localStorage persistence

About, features, usage and options are taken from the package README.