Overlays

Popover

A floating surface anchored to a trigger — a dense menu, a padded box, or a full header/body/footer form.

Importimport { Popover } from "@/components/ui/Popover";
Sourcesrc/components/ui/Popover

An anchored floating surface with three shapes: the default dense menu shell, a padded box for a small form, and a full header/body/footer composition for something closer to an inline dialog. If the contents are purely a list of actions, use a DropdownMenu — it brings the menu keyboard semantics with it.

Padded box

padded gives the content room to breathe — the right shape for two or three fields.

Placement

side and align set the preferred position; avoidCollisions lets it flip when there is not room. Prefer align="start" for a trigger at the left of its row, so the surface does not drift away from what opened it.

Props

Popover

PropTypeDefaultDescription
openbooleanControlled open state.
defaultOpenbooleanUncontrolled initial state.
onOpenChange(open: boolean) => voidCalled whenever it opens or closes.

PopoverContent

PropTypeDefaultDescription
paddedbooleanfalseSwitches from the dense menu shell to a padded box.
sideFloatingSidePreferred side: top, right, bottom or left.
alignFloatingAlignstart, center or end.
sideOffsetnumberGap between trigger and surface.
avoidCollisionsbooleanAllows flipping when there is not room on the preferred side.
closeOnInteractOutsidebooleanWhether a click outside dismisses it.