Skip to content

CSS: popover

.instui-popover — An elevated surface for a native [popover], positioned with CSS anchor positioning.

Source: popover.css

Usage

css
@import "@pantoken/components/components.css";
@import "@pantoken/components/popover.css";

Examples

html
<div class="instui-popover -placement-bottom" id="pop-1">
  <div class="instui-heading -level-h4">Share this page</div>
  <p class="instui-text -size-sm">A popover is a lightweight surface anchored to a trigger. This one uses the native <code>popover</code> attribute.</p>
</div>

Structure

text
.instui-popover
  heading (component)
  text (component)
    code
flowchart TD n0[".instui-popover"]:::cssdoc-root n1(["heading"]):::cssdoc-component n2(["text"]):::cssdoc-component n3("code"):::cssdoc-part n0 --> n1 n2 --> n3 n0 --> n2 click n1 "/api/css/heading.md" click n2 "/api/css/text.md" classDef cssdoc-root stroke-width:1px; classDef cssdoc-part stroke-width:1px; classDef cssdoc-slot stroke-width:1px; classDef cssdoc-component stroke-width:1px;

Modifiers

ModifierDescription
.-placement-bottomSit below the anchor.
.-placement-endSit at the end (inline-end) of the anchor.
.-placement-startSit at the start (inline-start) of the anchor.
.-placement-topSit above the anchor.

Conditions

TypeQueryDescription
supports(position-area: block-end)
supports(transition-behavior: allow-discrete)

Tokens consumed

TokenTypeValue
--instui-border-width-sm<length>0.0625rem
--instui-color-background-elevated-surface-base<color>light-dark(#ffffff, #171B21)LightDark
--instui-color-text-base<color>light-dark(#273540, #F2F4F5)LightDark
--instui-component-popover-border-color<color>light-dark(#8D959F, #6A7883)LightDark
--instui-component-popover-border-radius<length>0.75rem
--instui-elevation-above[ inset? && <length>{2,4} && <color>? ]# | none
--instui-spacing-space-sm<length>0.5rem

Browser support

  • Uses CSS anchor positioning (position-anchor/position-area) and the native [popover] API, both Chromium-only today; an @supports guard keeps the placement inert elsewhere, where the UA centres the popover in the top layer.

Subcomponents

  • tooltip — A tooltip is a smaller, hover- or focus-triggered anchored surface.
  • context-view — Context view is a related anchored surface with a pointer.