Repository navigation
Domma v0.49.0
v0.49.0 - Popovers (2026-09-27)
Popovers - E.popover() anchors a panel to a trigger: a title, text, a list or a small form,
opened by click, hover, focus or code, and closed by Esc, a click outside or its own close button. It
is the component help icons, quick-edit panels and profile cards are made of.
💬 Popover
-
E.popover(trigger, {title, content, placement, trigger, dismissible}). Content is text by
default; a DOM node, or a function returning one on every open, is used as it is;html: true
sends a string through the sanitiser first. -
Placement
top,bottom,left,rightorauto, each with-start/-end. The panel
flips to another side when there is no room, shifts to stay on screen with its arrow still on the
trigger, and follows scrolling and resizing. It lives at the end of<body>, so a card with
overflow: hiddencannot clip it, and sits above modals and slideovers. -
Accessible by default: a click popover is a dialog - focus moves in, Tab leaves it in page order,
Esc closes it and puts focus back on the trigger - witharia-haspopup,aria-expandedand
aria-controlskept up to date. Hover and focus popovers are tooltips joined by
aria-describedby, and hover ones open on keyboard focus too. Reduced motion skips the fade. -
One open at a time per
group; a popover opened from inside another keeps its parent open. -
show(),hide(),toggle(),setContent(),setTitle(),update(),destroy(), and
popover:show/shown/hide/hiddenevents on the trigger (showandhidecan be
cancelled). Nothing wraps the trigger, anddestroy()restores every attribute it set.
🏷️ In markup
-
data-popover="..."(always text),data-popover-title,data-popover-placementand friends,
ordata-popover-content="#template"for rich content, turned into popovers by
E.popover.scan(root).$.setup()takescomponent: 'popover'. -
New showcase page with a tutorial, and
docs/Popover.md.