Overlays
Popover <pm-popover>
Non-modal popover panel. Trigger with native popovertarget="id" on any button.
Anyone with the link can view it.
Ada LovelaceDesign systems, London
Overview
trigger="hover" turns it into a hover card: it opens when the element named by for is hovered or focused and stays open while the pointer is over the card, so its content can be read and clicked. Keep hover cards supplementary: touch users reach the same content by following the link. class="pm-mega" lays the panel out as a wide grid of link groups for a navigation (mega) menu.
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
trigger | 'click' | 'hover' | — | How it opens: by its popovertarget button (default), or on hover and focus of the for element. |
for | string | — | id of the element that opens a hover card. |
placement | 'bottom' | 'top' | 'start' | 'end' | — | Side of the trigger it opens on (default bottom); flips when there is no room. Regions are plain markup inside it: a <header> (a title and a line under it), a <div class="pm-popover-body"> and a <footer> for actions. With a body, the header and footer stay in place and the body scrolls when the popover is as tall as the screen (or as its own max-block-size). |
popover | 'auto' | 'manual' | — | Light-dismiss behaviour (default auto). |
Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.
Slots
| Slot | Description |
|---|---|
(default) | Panel content: anything, or a <header>, a .pm-popover-body and a <footer>. |