Popup

A floating overlay system for context menus, dropdowns, and any temporary anchored content. Supports cursor and element anchoring, multiple alignment modes, promise-based results, and nested popup hierarchies.

The global PopupManager is created automatically by Root. Retrieve it during descendant component initialization with getPopupManager(). When opening from an event, pass the event synchronously or capture currentTarget before awaiting; a null or non-element anchor throws.


Cursor & Anchored Positioning

Use pos to open at the cursor position, or anchor to open relative to an element. Pass a MouseEvent directly as anchor — the manager resolves currentTarget automatically. await the return value to get the resolved result.


Nested Popups

Wrap popup content in a PopupContainer to create an isolated child manager for that level. Use resolveRoot() to resolve the top-level promise from anywhere in the hierarchy. Right-click the area below.

Right-click anywhere in this area


Alignment Modes

The align option controls how the popup lines up with its anchor. both expands the popup to match the anchor's width — useful for full-width dropdowns.


Application setup

Place Root in the application layout, not inside each example. Context getters must run during component initialization under this provider.