Popover

Floating content panel triggered by a button. Compound component with Trigger and Content.

Example

Props

NameTypeDefaultRequiredDescription
openbooleanNoControlled open state
defaultOpenbooleanfalseNoInitial state (uncontrolled)
onOpenChange(open: boolean) => voidNoCalled when open state changes
anchorAnchor'bottom'NoPosition and alignment relative to trigger (e.g. bottom-center)
asChildbooleanfalseNoOn PopoverTrigger — merges trigger props onto the child element instead of rendering a wrapping <button>
maxWidthstringNoOn PopoverContent — overrides the default max-width (CSS value, e.g. "var(--layout-80)")

Accessibility

  • Trigger gets aria-expanded and aria-haspopup
  • Content has role and aria-labelledby
  • Escape closes the popover
  • Click outside dismisses

Related Tokens

--popover-surface--popover-on-surface--popover-border