Popover
A native nonmodal surface beside an ordinary trigger, with a bounded centered placement fallback.
When to use it. Use for a small group of optional controls without making the rest of the page inert. Use Dialog when modality is needed.
Popover primary example
How it works
-
<.popover>popover=auto or manual pairs with popovertarget and toggle/show/hide actions. Optional logical anchor placement and ordered flips use native CSS, not a positioning engine. -
package CSSPackage CSS adds the optional presentation only when its complete capability gate passes. Requires Popover and popovertarget. Missing anchors retain a viewport-bounded centered surface. Manual does not close on Escape or outside click. -
gallery onlyTheme switching, source copying, search, fixtures, and inspection controls on this page belong to the gallery only; :popover does not ship them. -
application boundaryDialog and Drawer are modal; Alert Dialog adds consequence semantics and safe cancel focus. Popover is nonmodal; Dropdown Actions contains ordinary controls, not ARIA menus. Tooltip and Hover Card are supplemental only. Use ordinary links for destinations, buttons for actions and visible Help for required guidance. Interest invokers and interactive previews are deferred.
Examples use package semantic tokens in explicit light and dark scopes.
Accessibility and browser support
Native Tab follows document order. Auto mode supports Escape and light dismiss; manual mode requires an explicit hide control. A title, accessible_label or external labelledby names the surface; no dialog or menu role is invented.
| Feature | Locked-engine evidence | When missing |
|---|---|---|
| Native baseline | Reviewed in the locked Chromium, Firefox, and WebKit evidence matrix. | Always-visible ordinary content below remains available. Without script, native controls still work when their required platform features exist. Without CSS, native dialogs/popovers still need invocation; supplemental content is visible in flow. Without invokers or Popover, use the ordinary alternative. Without anchors use bounded default placement; without transitions or with reduced motion it snaps. No hover/coarse pointer retains the complete trigger or link. Forced colors preserves borders and focus; narrow/zoomed text wraps, RTL uses logical edges or supplemental flow. Replacing the subtree does not restore its open state or focus. |
| Progressive enhancement | The locked-engine evidence exercises the authored complete capability gate. | Always-visible ordinary content below remains available. Without script, native controls still work when their required platform features exist. Without CSS, native dialogs/popovers still need invocation; supplemental content is visible in flow. Without invokers or Popover, use the ordinary alternative. Without anchors use bounded default placement; without transitions or with reduced motion it snaps. No hover/coarse pointer retains the complete trigger or link. Forced colors preserves borders and focus; narrow/zoomed text wraps, RTL uses logical edges or supplemental flow. Replacing the subtree does not restore its open state or focus. |
| Exact fallback | The locked-engine matrix retains the documented native or static outcome. | Always-visible ordinary content below remains available. Without script, native controls still work when their required platform features exist. Without CSS, native dialogs/popovers still need invocation; supplemental content is visible in flow. Without invokers or Popover, use the ordinary alternative. Without anchors use bounded default placement; without transitions or with reduced motion it snaps. No hover/coarse pointer retains the complete trigger or link. Forced colors preserves borders and focus; narrow/zoomed text wraps, RTL uses logical edges or supplemental flow. Replacing the subtree does not restore its open state or focus. |
Ordinary alternative: complete information and controls
Read the complete manual and review preferences here without opening a surface. No data is saved or deleted.
Practical guidance, also available in the complete manual. Also available as plain text.
معلومات إضافية متاحة أيضًا في الدليل الكامل.
Required help stays visible. A real application must provide its complete task here or at an ordinary route, not only inside an overlay.
Application ownership and API
Applications own routes, authorization, CSRF, validation, persistence, loading, outcomes and replacement. Replacing an open subtree may close it and lose native focus; these examples do not restore it or synchronize state. No real operation is executed.
Choosing the related control. Dialog and Drawer are modal; Alert Dialog adds consequence semantics and safe cancel focus. Popover is nonmodal; Dropdown Actions contains ordinary controls, not ARIA menus. Tooltip and Hover Card are supplemental only. Use ordinary links for destinations, buttons for actions and visible Help for required guidance. Interest invokers and interactive previews are deferred.
Provenance
Catalogue identity overlays.popover, adapted from
unscripted/ui commit bd8f403030c8d1f46804da6eda733fde7e908e63
under its MIT notice.
The documentation presentation is adapted locally; ShadcnUI's Phoenix API and native semantic contract remain authoritative.
Adapt native nonmodal Popover into deterministic HEEx with protected names and invoker actions, capability-gated implicit anchoring and ordered flips, readable centered fallback, and no state or positioning runtime.