All work

DockableLayout

Drag-and-drop panel layouts for web apps, like an IDE

Dark panel layout with a Console tab being dragged over the right side of the Properties panel, which shows a blue drop zone

The problem

Tools for editing, monitoring or building things often need many views on screen at once: a viewport, a property list, a console, a file tree. Desktop apps like Blender, Unity and VS Code let people arrange those views themselves. Web apps usually ship one fixed layout, and the libraries that do this tend to tie you to one framework.

I wanted that desktop-style layout in the browser as a single plain JavaScript file that works with vanilla JS, React, Vue or anything else.

What I built

  1. The whole layout is one tree of rows, columns and panels. Every drag, resize or close changes the tree and redraws it, so the state is always easy to read, save and restore.
  2. Tab dragging uses pointer events rather than the browser's built-in drag-and-drop, so it behaves the same everywhere and shows a ghost tab plus clear drop indicators.
  3. Hovering a panel while dragging shows five zones, VS Code style: drop on a side to split a new panel there, or in the middle to add the tab to that panel.
  4. Dropping near the outer edge of the layout docks the tab as a new full-width or full-height panel. Panels left empty are removed and their neighbours fill the space.
  5. It emits events for every tab move, dock and resize, and can save and load the layout from the browser's local storage.
  6. Behaviour is covered by headless-browser tests that drive real pointer drags for resizing, reordering, edge docking, zones and reflow.

What it does

Built with Vanilla JavaScript, CSS custom properties, Pointer events, Puppeteer (tests), 2026.