Search documentation

Find a component or a docs page

Popover

Displays rich content in a portal, triggered by a button.

Usage

Example

A click, Enter or Space on the trigger opens the popover; Escape or a click outside closes it, and focus goes back to the trigger unless the click moved it to another control. PopoverTitle names the dialog and PopoverDescription describes it for screen readers.

Sides

Content without a PopoverTitle needs aria: {label:} so the dialog has a name. side: places the content around the trigger: :top, :right, :bottom (the default), :left, or the logical :inline_start and :inline_end, which follow the writing direction. side_offset: is the gap in pixels (4 by default). The content flips to the other side when there is no room.

Alignments

align: lines the content up with the trigger's :start, :center (the default) or :end. align_offset: shifts it along that edge.

With form

Open on hover

open_on_hover: also opens the popover when the pointer rests on the trigger for delay: milliseconds (300 by default), and closes it close_delay: milliseconds (0 by default) plus a 100 ms grace after the pointer leaves both the trigger and the content, so the pointer can cross the gap onto the content. A click, Enter or Space still opens it, so it stays usable from the keyboard.

In a dialog

Escape closes the popover first and leaves the dialog open.

Inside a clipping container

The content opens in the top layer, so a container that hides its overflow (a scroll area, a table cell, a card) doesn't clip it.

Installation

Components

ComponentBuilt usingSource
PopoverPhlex
PopoverContentPhlex
PopoverDescriptionPhlex
PopoverDocsPhlex
PopoverHeaderPhlex
PopoverTitlePhlex
PopoverTriggerPhlex
PopoverControllerStimulus JS