--- title: Popover description: An accessible popup anchored to a trigger button. links: doc: https://base-ui.com/react/components/popover#api-reference --- ## Preview ## Installation CLI Manual ```bash npx @olyx/cli@latest add popover ``` Install the following dependencies: ```bash npm install @base-ui/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage ```tsx import { Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, } from "@/components/ui/popover" ``` ```tsx Open Popover Popover Title Popover description text. ``` ## API Reference #### Popover Root component. Alias for `Popover.Root` from Base UI. #### PopoverTrigger Trigger button that opens the popover. Alias for `Popover.Trigger` from Base UI. #### PopoverContent Popup container that displays the popover content. Wraps `Popover.Portal`, `Popover.Positioner`, and `Popover.Popup`. | Prop | Type | Default | | ------------- | ---------------------------------------------- | ---------- | | `side` | `"top" \| "bottom" \| "left" \| "right"` | `"bottom"` | | `align` | `"start" \| "center" \| "end"` | `"center"` | | `sideOffset` | `number` | `8` | | `alignOffset` | `number` | `0` | #### PopoverHeader Container for the title and description. Plain `div` with bottom margin. #### PopoverTitle Title text for the popover. Styled wrapper for `Popover.Title` from Base UI. #### PopoverDescription Description text for the popover. Styled wrapper for `Popover.Description` from Base UI. ## Examples ### With Close Button ### Tooltip Style