Feature Library

Beside, never over: placing editors and popovers

1.04 CPU ms
A still of the Beside, never over: placing editors and popovers demo
Still
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

1.04 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.

On every machine it was measured on
MachineGPU msCPU msCPU p95
unknown GPU · 13th Gen Intel(R) Core(TM) i9-13900Hreference · measuring toolnot timed1.041.95
apple · Apple A19 Proin a browser tab · 16 November 2026not timed1.622.66
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 2026not timed1.262.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

  1. An item’s editor on a board or canvas
  2. Inspectors beside a selected chart or shape
  3. Popovers and pickers opened from a button
  4. Menus and flyouts on short screens
  5. Property panels that must not hide what they change
  6. A selection toolbar that keeps off nearby cards and lines and clear of a side rail

Pitfalls, in brief

  1. 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.
  2. The follower rests after a few still frames: call follow() whenever the item may move (a drag, your own animation, a zoom).
  3. 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.
  4. 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.
  5. 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
  1. Options are read on every placement: change gap, prefer, min or bringTo on the object you passed, then call place().
  2. 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.
  3. 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.

popoverplacementpositioningflipshifttaildockinginspectortoolbarcollisioncanvasdomno dependencies

Near it in the frame