StellarUI

<stellar-popover>

anchored popover for interactive content that opens from an anchor click.

Properties

Component
Example

Preview

Popover title

This surface can hold interactive controls, not just passive help text.

Cancel Continue

Markup

Copy
<button
  id="popover-demo-anchor"
  type="button"
>
  Open popover
</button>
<stellar-popover for="popover-demo-anchor">
  <div style="display:grid;gap:0.75rem;">
    <div style="display:grid;gap:0.35rem;">
      <strong>Popover title</strong>
      <p style="margin:0;">This surface can hold interactive controls.</p>
    </div>
    <div style="display:flex;gap:0.5rem;justify-content:flex-end;">
      <button type="button" data-popover="close">Cancel</button>
      <button type="button">Continue</button>
    </div>
  </div>
</stellar-popover>

API

Complete props, events, slots, and implementation notes for the shipped popover.

Props

PropTypeDefaultNotes
forstring''ID of the anchor element that toggles and positions the popover.
openbooleanfalseShows or hides the popover. The component also mutates this prop when the anchor is clicked or dismissal occurs.
placementtop | top-start | top-end | bottom | bottom-start | bottom-end | right | right-start | right-end | left | left-start | left-endtopPreferred anchored placement. The component flips to the opposite side when the preferred side overflows more.
distancenumber8Main-axis gap between the anchor and the popover surface.
offsetnumber0Cross-axis slide along the anchor edge.
without-arrowbooleanfalseHides the arrow while keeping the same anchored open/close behavior.

Events

EventSourceNotes
before-openstellar-popoverCancelable event emitted right before the popover opens.
openstellar-popoverEmitted after the popover opens.
before-closestellar-popoverCancelable event emitted right before the popover closes.
closestellar-popoverEmitted after the popover closes.

Slots

SlotNotes
defaultPopover body content. Interactive controls are allowed here, unlike stellar-tooltip.

Notes

  • The public tag is `stellar-popover`, anchored to another element by its `for` id and toggled by clicking that anchor.
  • Unlike `stellar-tooltip`, the default slot may contain interactive controls. The demo keeps the anchor label and body copy in `Example Properties` because they are authored children, not component props.
  • The component emits cancelable `before-open` and `before-close` events, then `open` and `close` after the state change lands.
  • Clicks outside the popover close it, Escape closes it and returns focus to the anchor, and `[data-popover='close']` gives authored content an explicit dismiss affordance.
  • `placement`, `distance`, and `offset` follow the shipped anchored-surface contract, while the implementation stays local and native to Rocket instead of pulling in Floating UI just for this port.
  • Only one popover stays open at a time unless it is an ancestor of the newly opened one, matching the shipped nested popover behavior.