How it works › Resizable panels

Resizable panels

Every side panel is resizable by dragging, on by default: the kit's own side peek and rail, and any panel of the host's that says data-resizable. The width is remembered, a double-click resets it, and ← / → move the focused edge 16 px. The sidebar on this page is one: drag its right edge.

A rail and a peek, both resizable

Live

Drag the line right of the rail. Click a run to open the peek, then drag its left edge. Both widths are stored per panel and come back on reload.

The live view starts when it scrolls into sight.

From the example ML experiment tracking

A host's own panel

Put data-resizable="left|right" (the edge the handle sits on) on any element. The kit writes the width as --data-panel-width on the panel, only once one is set, so your CSS keeps the layout:

index.html
<nav class="side" id="side" data-resizable="right"
     data-resizable-min="180" data-resizable-max="420">…</nav>

<style>
  .layout { display: grid; grid-template-columns: auto minmax(0, 1fr); }
  .side { width: var(--data-panel-width, 240px); }
</style>
<script type="module" src="/vendor/data-ui/resize.js"></script>

data-ui.js gives every such element its handle when it loads; a page that loads nothing else of the kit loads dist/resize.js (about 5 KB, its stylesheet inside). From script: makeResizable(el, {edge, min, max, keep, key, label}) returns {handle, width, set(px), reset(), destroy()}. See it alone on a plain page.

The kit's panels

Comes from docs/CONTRACT.md §11 (resizable side panels) in docs/.