Popover

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

Installation

pnpm add @ag/ui

Usage

import {
  Popover,
  PopoverContent,
  PopoverDescription,
  PopoverHeader,
  PopoverTitle,
  PopoverTrigger,
} from "@ag/ui"
<Popover>
  <PopoverTrigger asChild>
    <Button variant="outline">Open Popover</Button>
  </PopoverTrigger>
  <PopoverContent>
    <PopoverHeader>
      <PopoverTitle>Title</PopoverTitle>
      <PopoverDescription>Description text here.</PopoverDescription>
    </PopoverHeader>
  </PopoverContent>
</Popover>

Composition

Use the following composition to build a Popover:

Popover
├── PopoverTrigger
└── PopoverContent

Examples

Basic

A simple popover with a header, title, and description.

Align

Use the align prop on PopoverContent to control the horizontal alignment.

With Form

A popover with form fields inside.

RTL

To enable RTL support in shadcn/ui, see the RTL configuration guide.

API Reference

See the Radix UI Popover documentation.