GitHub

Popover

An overlay that displays additional information or options when triggered.

Installation

Usage

Title and Description

You can use <PopoverHeader /> in two ways:

Using props

You can pass title and description props directly to <PopoverHeader />. In this case, you don't need to use <PopoverTitle /> and <PopoverDescription /> components.

Using components

Alternatively, you can use <PopoverTitle /> and <PopoverDescription /> as children for more control.

Positioning

Control the position of the popover relative to the trigger using the positioning prop.

Examples

Non-modal

To make the popover non-modal, set the modal prop to false.

In some cases, you might want the popover to not trap focus or block interaction with the rest of the page.

Nested

Nest popovers within one another.

Anchor

Use <PopoverAnchor /> to position the popover relative to a different element than the trigger.

Close button

Use showCloseButton prop to show a close button in the top-right corner.

Close behavior

Use closeOnInteractOutside and closeOnEscape props to prevent closing on outside click and escape.

Scroll area

Make the content area scrollable while keeping header and footer fixed using ScrollArea.

Inside dialog

Render a popover inside a dialog.

API Reference

Popover

Root element of the popover.

PopoverTrigger

Button that opens the popover. Renders a button.

PopoverAnchor

Element the popover is positioned relative to. Use when the reference is not the trigger.

PopoverContent

Container for the popover content. Renders a div inside a portal.

PopoverHeader

Header container. Accepts title and description props or children.

PopoverTitle

Title element. Renders a div (Ark: accessible title).

PopoverDescription

Description element. Renders a div (Ark: accessible description).

PopoverBody

Content area. Wrapped in ScrollArea. Renders a div.

PopoverFooter

Footer container. Renders a div.

PopoverClose

Button that closes the popover. Renders a button.

PopoverArrow

Arrow pointing to the trigger. Renders a div. Optional.


For a complete list of props and more information, see the Ark UI Popover documentation.