--- title: Popover description: Displays rich content in a portal, triggered by a button. base: radix component: true links: doc: https://www.radix-ui.com/docs/primitives/components/popover api: https://www.radix-ui.com/docs/primitives/components/popover#api-reference --- ## Installation Command Manual ```bash npx shadcn@latest add popover ``` Install the following dependencies: ```bash npm install radix-ui ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage ```tsx showLineNumbers import { Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, } from "@/components/ui/popover" ``` ```tsx showLineNumbers Title Description text here. ``` ## Composition Use the following composition to build a `Popover`: ```text Popover ├── PopoverTrigger └── PopoverContent ``` ## 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](/docs/rtl). ## API Reference See the [Radix UI Popover](https://www.radix-ui.com/docs/primitives/components/popover#api-reference) documentation.