Popover is a compound component that displays contextual content anchored to a trigger element. By default it opens on click and closes when clicking outside, pressing Escape, or when focus moves away.
Sub-components
| Component | Description |
|---|---|
Popover.Root | Manages popover state and provides context to child components. |
Popover.Trigger | The element that toggles the popover open/closed on click. |
Popover.Popup | The popover popup container with content. |
Popover.Arrow | Optional decorative arrow pointing to the trigger. |
Import
Basic Usage
Open on Hover
Popover.Root Props
Controlled open state. When provided, the component operates in controlled mode.
Initial open state for uncontrolled usage. Defaults to
false.When
true, the popover opens on pointer hover instead of click. Defaults to false.Milliseconds before the popover opens on hover (when
openOnHover is enabled). Defaults to 0.Milliseconds before the popover closes after the pointer leaves (when
openOnHover is enabled). Defaults to 0.Whether pressing
Escape closes the popover. Defaults to true.Whether clicking outside the popover closes it. Defaults to
true.Called when the open state changes. Fires immediately, before animations complete.
Called after open/close animations complete.
Popover.Trigger, Popover.Popup, and optionally Popover.Arrow elements.State Data Attributes
These attributes are reflected on thePopover.Popup element.
| Attribute | Value / Description |
|---|---|
data-open | Present when the popover is open. |
data-side | "top" | "bottom" | "left" | "right" — current placement side. |
data-align | "start" | "center" | "end" — current alignment. |
data-starting-style | Present during the open animation. |
data-ending-style | Present during the close animation. |
CSS Styling Example
Accessibility
The trigger receivesaria-expanded reflecting the open state. When modal is set, the popup receives aria-modal="true". Closing via Escape is enabled by default and can be disabled with closeOnEscape={false}.