Use cases
- Filter panels — expose filter controls anchored to a toolbar button.
- Quick-edit forms — inline editing without opening a full dialog.
- Color/date pickers — rich controls that float near their trigger.
- Information panels — show extra detail on demand without navigating away.
When NOT to use
- Simple labels — use Tooltip. Popovers are heavier.
- Modal confirmations that block the page — use Dialog.
- Right-click menus — use ContextMenu.
Sizes
| Size | Width | Use when |
|---|---|---|
sm | 200 px | Short messages, single controls. |
md | 300 px | Default. Filter panels, small forms. |
lg | 400 px | Multi-field forms, complex pickers. |
Composition
- Popover is controlled via
open/onOpenChange. Uncontrolled mode works without props. - Web Popover composes the shared Popper positioning layer, so arrow placement, collision handling, flipping, portal behavior, outside pointer dismissal, and Escape dismissal stay consistent with other floating components.
PopoverContentrenders withrole="dialog"— interactive children (inputs, buttons) are keyboard-accessible by default.- Pass
side(top,bottom,left,right) onPopoverContentto position relative to the trigger. - Pass
arrowonPopoverwhen the panel needs a pointer connected to the trigger. - Pass
matchReferenceWidthonPopoverwhen a full-width trigger and floating panel must stay aligned in responsive form layouts. PopoverContentaccepts any React content, including async-loaded panels, form controls, rich descriptions, and tokenized custom layouts. Keep async loading states explicit with Skeleton or muted text.- Use
arrowClassNameto theme the arrow with the same background/border tokens as custom content. - Outside clicks and
Escapeboth dismiss viaonOpenChange(false).
Related
- Tooltip — hover hint, non-interactive.
- Dialog — modal overlay for confirmations.
- HoverCard — hover-triggered preview panel.
- DropdownMenu — action list anchored to a trigger.