The live demo starts when it’s in view.Click a card, then drag it toward an edge or another card · click the card under the zoom rail · drag the board to pan
Puts an editor, popover or inspector beside the item it edits, never on top of it.
What it costs a frame
CPU
1.04 ms
02468101216.7 ms
GPU
not used
CPU, median
1.04 ms
CPU, 95th pct
1.95 ms
Draw calls
0
Weight
Moderate
Measured 11 November 2026 on 13th Gen Intel(R) Core(TM) i9-13900H, Chrome 157, 1920×1080 at 1×. 600 frames × 3 rounds, median kept. What ran: Measured exercising itself: a card circles the board every frame and its editor follows it, choosing a side, sliding along it and redrawing the four candidate sides. Idle, the follower rests and nothing runs. Phones: tiers are being measured next.
apple · Apple A19 Proin a browser tab · 16 November 2026
not timed
1.62
2.66
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 2026
not timed
1.26
2.02
Bars against one 16.7 ms frame. A browser-tab run is timed in a visible tab without the tool’s scripted input, so read it as close, not exact.
What it needs
Renders with
DOM and CSSPlain DOM and CSS: every current browser.
Your browser
Runs hereNo WebGPU needed
Depends on
NothingNo other packages
What it’s for
An item’s editor on a board or canvas
Inspectors beside a selected chart or shape
Popovers and pickers opened from a button
Menus and flyouts on short screens
Property panels that must not hide what they change
A selection toolbar that keeps off nearby cards and lines and clear of a side rail
Pitfalls, in brief
Rects are viewport pixels (getBoundingClientRect) for the target and the area alike; the binder turns them into left and top for the editor’s containing block.
The follower rests after a few still frames: call follow() whenever the item may move (a drag, your own animation, a zoom).
It stays still while the pointer is over the editor or dragging from it, so it never jumps out from under a click; it catches up when the pointer leaves.
bringTo is asked at most once per opening (reset() is an opening): if the view moved under your own zoom or pan, the editor docks rather than fighting you.
With min, the binder writes width and height when it shrinks or docks: lay the editor out as a column with its body scrolling (min-height: 0; overflow: auto), or the bottom is cut off.
3 more in brief
Options are read on every placement: change gap, prefer, min or bringTo on the object you passed, then call place().
Keep the area clear of your own fixed chrome (a top bar, a bottom toolbar): pass it in rather than the whole window, or the editor slides under them.
covers is asked up to once a side on every placement, and the follower only notices the item and the area moving: keep covers cheap (a spatial index, not a DOM walk), leave out the item itself, and call place() when other content moves under the editor.
8 pitfalls in full, the hook-up guide, the module source and its tests come with the part.
Where it comes from
From SpaciousPro. Fully custom code.
WAI-ARIA Authoring Practices Guide (W3C): the menu button pattern for the demo’s More menu, and the dialog pattern’s non-modal use for the editor (labelled, Esc closes it and focus goes back to the item). Written here from scratch.
Orthogonal connectors routed round every box by A* over a sparse grid, with a bend cost and a tie-break that keeps elbow corners from flipping as things move…