Skip to content
GitHub (opens in a new tab)

Popover

A panel anchored to a trigger.

stableMoleculecontracts/popover.json

Preview

Popover

A panel anchored to a trigger. Click opens it. Escape and a click outside close it and return focus to the trigger.

Master

Help text is HelpPopover. A menu of commands is DropdownMenu. A blocking step is Modal.

Usage

The trigger is one focusable control. The panel is a dialog named by label. It takes the same eyebrow, tone, title and footer as Modal. Focus moves to the first field and Tab stays inside until Escape or a click outside.

Do's

  • A small panel of content or actions anchored to a button
  • Something that should not take over the page the way a Modal does
  • Which one: Tooltip names a control in a few words; HelpPopover explains it in one to three sentences; Popover holds fields or actions and takes focus. None of them is a menu or a blocking decision.

Don'ts

<Popover
  label="Share INV-1842"
  eyebrow="Billing · Invoices"
  title="Share INV-1842"
  trigger={<Button appearance="outline" mode="neutral">Share</Button>}
  footer={<Button appearance="solid" mode="primary" size="sm">Copy link</Button>}
>
  Anyone at Northwind with the link can view this invoice.
</Popover>

A panel anchored to a trigger. Click opens it. Escape and a click outside close it.

When to use

  • A small panel of content or actions anchored to a button
  • Something that should not take over the page the way a Modal does
  • Which one: Tooltip names a control in a few words; HelpPopover explains it in one to three sentences; Popover holds fields or actions and takes focus. None of them is a menu or a blocking decision.

When not to use

  • One or two sentences of help — use HelpPopover
  • A one-line name — use Tooltip
  • A menu of commands — use DropdownMenu
  • A blocking decision — use Modal

What an agent reads

import { Popover } from "agentic-ds-kit";
must
  • Escape closes only this panel, not a parent Modal, Drawer or AlertDialog
  • Trigger gets aria-haspopup=dialog, aria-expanded, and aria-controls
  • Panel is role=dialog and labelled by label
  • Escape closes and returns focus to the trigger
  • A pointer down outside the trigger and the panel closes it
  • Focus moves to the first field on open; Tab and Shift+Tab stay inside the panel until Escape or a click outside
defaults
  • tone neutral
  • placement bottom
  • defaultOpen false
stops if
  • Do not use Popover for help text — use HelpPopover
  • Do not use Popover as a date or select menu — use DatePicker, DateRangePicker, or Select
  • Do not use raw hex
  • Do not add a Close button, scrim or page lock — Escape and a click outside close it; use Modal for a blocking decision

From contracts/popover.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.

Props

NameTypeRequiredDefaultNotes
triggerelementYes—One focusable control. Click toggles the panel.
childrenslotYes—Panel content.
labelstringYes—Names the dialog.
titlestringNo—Heading at the top of the panel, 18px at heading weight. eyebrow and tone show only with a title. label still names the dialog.
eyebrowstringNo—Short area name above the title, 12px, like Billing · Invoices. Caller-provided.
toneenumNoneutralTone icon (16px, aria-hidden) and status word from KitLabels before the eyebrow, so status is never colour alone. Same header as Modal. neutral | info | success | warning | danger
footerslotNo—kit Buttons, size sm, bottom right. At most one appearance=solid mode=primary.
footerStartslotNo—Left of the footer actions: an Ask Button (outline neutral sm, MessageCircle) or a count. Labels are caller-provided.
placementbottom | top | left | rightNobottomPreferred side. Lines up with the trigger's start edge, flips when there is no room and stays inside the viewport.
openbooleanNo—Controlled visibility.
defaultOpenbooleanNofalse—
onOpenChangefunctionNo—(open: boolean) => void
  • Component
    →

    HelpPopover

    Small help panel: optional title plus one to three short sentences.

  • Component
    →

    Tooltip

    Brief supplementary text on hover or focus of a trigger element.

  • Component
    →

    DropdownMenu

    Actions or value menu from a button, field, or nav trigger.

  • Component
    →

    Modal

    Dismissible overlay for short tasks, forms, or extra detail.