Skip to content

Popover

⋯

Popover renders an interactive popup anchored to a trigger or custom point. Its composition and panel layout follow Kumo Popover, with Nesra semantic tokens for its surface, text, border, radius, and shadow. The Nesra Figma library has no generic Popover design.

Import Popover from @nesra/ui/popover or @nesra/ui.

Popover
├── Popover.Trigger
└── Popover.Content
├── Popover.Title
├── Popover.Description
├── interactive content
└── Popover.Close

Content combines Base UI’s portal, positioner, and popup. Title names the popup; Description adds explanatory text. Render a Close button when the user needs an explicit way to finish or dismiss the content.

Popover.Close gives the user an explicit way to dismiss the popup and return focus to its trigger.

The page owns form state and submission. This example copies the current report name into a draft when the popup opens, saves it on submit, and closes without saving on Cancel.

Quarterly review

side sets the preferred side. Viewport collisions can move the popup.

Content can hold a custom layout. Set its width with className when the content needs a fixed measure.

Click is the default trigger. openOnHover also opens on pointer hover, with delay in milliseconds. Keep a close control inside hover-triggered interactive content.

anchor positions the popup against an element or virtual point instead of the trigger. A controlled popup can open without a Popover.Trigger. In that case, set finalFocus to the control that opened it.

Quarterly review

Popover.Content uses --nesra-surface-popover-bg-neutral, --nesra-stroke-border, and --nesra-text-body, so the panel follows the active theme. Popover.Description uses --nesra-text-support. Trigger and close focus use shadow-nesra-focus-ring, which is gray-600 in Light and gray-400 in Dark.

  • Trigger opens on press and exposes expanded state. Give an icon-only trigger an accessible name.
  • Focus moves to the first tabbable element in Content by default. Escape, outside press, and Close dismiss the popup. Focus returns to the trigger after dismissal.
  • Title labels the dialog. Use it unless the popup receives another accessible name. Label form fields inside the popup and handle form state and submission in the consuming page.
  • The default popup is non-modal. Set modal on Popover only when page interaction must be restricted, and include Popover.Close so keyboard and touch screen reader users can exit.
Prop Type Default Effect
defaultOpen boolean false Initial uncontrolled state.
open boolean — Controlled open state.
onOpenChange (open, eventDetails) => void — Receives open and dismissal changes.
modal boolean | "trap-focus" false Controls focus and outside behavior.

Other Base UI Popover Root props are forwarded.

Renders a button by default. render composes another button. disabled prevents opening. openOnHover defaults to false; when enabled, delay defaults to 300ms and closeDelay defaults to 0ms. Other Base UI Trigger props are forwarded.

Prop Type Default Effect
side "top" | "bottom" | "left" | "right" "bottom" Preferred side; collisions may flip it.
align "start" | "center" | "end" "center" Preferred alignment.
anchor Base UI anchor element, ref, or virtual anchor trigger Positions relative to another anchor.
sideOffset number (px) 4 Gap from the anchor.
alignOffset number (px) 0 Offset along the alignment axis.
positionMethod "absolute" | "fixed" "absolute" CSS positioning method.
collisionPadding Base UI padding 12 Minimum viewport clearance.
container Base UI portal container document.body Portal destination.
initialFocus Base UI focus target first tabbable Focus target after opening.
finalFocus Base UI focus target trigger Focus target after closing.
className string | state callback — Popup classes.

Other Base UI Positioner props are forwarded. Content has no fixed width. Its default panel has 16px horizontal and 12px vertical padding, an 8px radius, a border, a medium shadow, and a 150ms opacity transition that respects reduced motion. These follow Kumo’s panel pattern, mapped to Nesra tokens. No Popover dimensions or states are specified in Nesra Figma.

Popover.Title, Popover.Description, and Popover.Close

Section titled “Popover.Title, Popover.Description, and Popover.Close”

Each forwards the corresponding Base UI part props. Title renders an h2, Description a paragraph, and Close a button by default. render can compose another element where the underlying part allows it.

See colors and shape and elevation for token values.