Popover
Show anchored interactive content from click or hover.
Use Popover for anchored interactive content that does not need the structure of a full dialog. Use Tooltip for brief, non-interactive hints.
Basic usage#
Playground#
Anatomy#
Content is portaled inside an internal positioning wrapper.
Usage#
Trigger modes and state#
Render the trigger with the supplied props. Click mode is the default; hover mode also responds to focus and blur and can use open and close delays. Use controlled open state only when the application needs to coordinate visibility.
Dismissal and accessibility#
Escape and outside interaction close a dismissible popover. Give Popover.Content an accessible
name with ariaLabel when it has no visible label.
modal defaults to false. With modal={true} and a composed Popover.Close, focus stays inside
the content, outside content is hidden from assistive technology, and body scroll is locked.
Without a Close, the popover stays non-modal so users retain a dismissal route.
modal={false} does not disable Escape or outside dismissal; use dismissible for that.
preventScroll can lock body scroll independently of modal.
Keyboard interaction#
Keyboard behavior depends on the trigger element and whether the popover is modal. Escape requests dismissal when the popover is dismissible; focusable controls inside non-modal content participate in normal document focus order. Modal content contains focus.
Examples#
Hover mode#
Dismiss control#
Attributes#
data-closedSlot: popover-trigger, popover-contentDescription: Present when disclosure or transition content is closed.data-disabledSlot: popover-triggerDescription: Present when the component, slot, or item is disabled.data-expandedSlot: popover-trigger, popover-contentDescription: Present when the panel, accordion, or menu is expanded.data-alignSlot: popover-contentDescription: Stores the resolved alignment of positioned content.data-sideSlot: popover-contentDescription: Stores the resolved floating or drawer content side.Props#
Popover#
Trigger#
Renders a <button> element by default.
Content#
Props for the Popover component. Renders a <div> element by default.
Close#
Renders a <button> element by default.