Skip to content

Popover

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

Install

Bash
npx @madeui/cli add popover

Usage

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

Composition

TSX
<Popover>
  <PopoverTrigger />
  <PopoverContent>
    <PopoverHeader>
      <PopoverTitle />
      <PopoverDescription />
    </PopoverHeader>
  </PopoverContent>
</Popover>

Placement

Header, title, description

PopoverHeader is a plain layout wrapper; PopoverTitle and PopoverDescription are Base UI’s Popover.Title / Popover.Description, wiring up aria-labelledby / aria-describedby on the popup automatically.

With form

API reference

Built on Base UI Popover. The tables below cover the props this library adds or changes — every other prop is forwarded to the underlying Base UI part; see the Base UI Popover API reference for the full list.

PopoverContent

PropTypeDefaultDescription
side'top' | 'right' | 'bottom' | 'left''bottom'
sideOffsetnumber4
align'start' | 'center' | 'end''center'
alignOffsetnumber0
styleStyleXStyles—StyleX styles merged last — always win over the component’s own styles.

Popover (Root), PopoverTrigger, and PopoverClose are Base UI parts re-exported unstyled — Root accepts open / defaultOpen / onOpenChange; Trigger accepts render.

Styling

PopoverHeader, PopoverTitle, PopoverDescription accept style (StyleXStyles, merged last so caller overrides always win) plus all native props of the element they render.

Was this page helpful?