Skip to content

Popover

BetaFeedback and overlaysOpen in the workshop

Rich, interactive content anchored to a trigger: a metric explained, a quick edit.

.xg-popover (works with the native popover attribute)

Example and markup

Live, from xg-ui.css and xg-ui.js. Switch the brand and mode on the example itself, or for the whole site in the header.

Popover

Fill rate

Matched requests divided by all requests sent to demand partners, for the selected period.

How it is calculated

Static render

Matched requests divided by all requests sent to demand partners.

Markup
<button class="xg-btn xg-btn--ghost xg-btn--sm" type="button" popovertarget="pop-fill">What is fill rate? <svg class="xg-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
<circle cx="12" cy="12" r="9"/>
<path d="M9.5 9.5a2.5 2.5 0 1 1 3.5 2.3c-.6.3-1 .9-1 1.6v.6"/>
<path d="M12 17h.01"/>
</svg>
</button>
<div class="xg-popover" id="pop-fill" popover>
<h4 class="xg-h4" style="margin-bottom:6px">Fill rate</h4>
<p style="margin:0 0 8px" class="xg-text-sm">Matched requests divided by all requests sent to demand partners, for the selected period.</p>
<a class="xg-link xg-link--arrow xg-text-sm" href="#">How it is calculated</a>
</div>
<div class="xg-popover" style="margin-top:16px">
<h4 class="xg-h4" style="margin-bottom:6px">Static render</h4>
<p style="margin:0" class="xg-text-sm">Matched requests divided by all requests sent to demand partners.</p>
</div>

When to use it

Use it for

explaining a metric with a link; a quick inline edit of one value.

Not for

plain labels (Tooltip); forms with more than two fields (Modal or Drawer).

Rules

  • Opens on click, closes on Escape and outside click.
  • One heading, a few lines, at most one action.

Accessibility

  • Native popover attribute with popovertarget on the trigger handles focus return and light dismiss.

Every color pair this component uses is measured for both brands in light and dark on the Accessibility page.

Also in Feedback and overlays: Modal, Alert dialog, Drawer, Toast, Alert.

Status Beta: usable; class names may still change in a minor release, with a note (see Releasing).