compacto-ui

Search documentation

Jump to a page or a component.

Popover

A small aside anchored to a control. Heavier edge than a tooltip.

Preview

Installation

No install — ask an AI agent to copy this component from registry.json.

import { Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger } from "@/components/ui/popover";

Notes

  • A border-2 surface — one step heavier than a tooltip's hairline, because a popover is a place you work rather than a hint you read.
  • Use it for a small aside anchored to a control. Anything that interrupts the task and demands a decision is a Dialog.
  • Scrolls internally past 60vh instead of growing off-screen, and keeps 8px clear of the viewport edge.
  • PopoverTitle renders a div, not a heading — a popover is not a landmark.

Props

The props worth knowing. Everything else passes straight through to the underlying element, including className, which is merged last so it always wins.

PropTypeDefaultDescription
align"start" | "center" | "end""center"Alignment against the trigger.
sideOffsetnumber6Gap between trigger and panel, in px.