DockableLayout
Drag-and-drop panel layouts for web apps, like an IDE
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
- 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.
- 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.
- 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.
- 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.
- It emits events for every tab move, dock and resize, and can save and load the layout from the browser's local storage.
- Behaviour is covered by headless-browser tests that drive real pointer drags for resizing, reordering, edge docking, zones and reflow.
What it does
- Drag a tab to reorder it within its panel or move it to another panel
- Drop a tab on a panel's side to split it, with a highlighted target zone
- Drop a tab on the layout edge to dock a new panel along that edge
- Drag the handles between panels to resize; double-click to reset
- Live event log shows each move, dock and resize as it happens
Built with Vanilla JavaScript, CSS custom properties, Pointer events, Puppeteer (tests), 2026.