# Popover

> Floating popover anchored to a trigger.

Registry name: `popover`. HTML docs: https://ui.anuragroy.dev/component/popover.

## Install

```bash
npx shadcn@latest add https://ui.anuragroy.dev/r/popover.json
```

If the website is down: `npx shadcn@latest add https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/popover.json`.

Registry JSON: https://ui.anuragroy.dev/r/popover.json (GitHub: https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/popover.json).

## Import

Import paths follow the consumer `components.json` aliases. After a default install:

```tsx
import {
  Popover,
  PopoverContent,
  PopoverDescription,
  PopoverTitle,
  PopoverTrigger
} from "@/components/ui/popover"
```

## Usage

```tsx
import { Button } from "@/components/ui/button"
import {
  Popover,
  PopoverContent,
  PopoverDescription,
  PopoverTitle,
  PopoverTrigger,
} from "@/components/ui/popover"

export function Example() {
  return (
    <Popover>
      <PopoverTrigger render={<Button variant="outline" />}>
        Open popover
      </PopoverTrigger>
      <PopoverContent>
        <PopoverTitle>Popover</PopoverTitle>
        <PopoverDescription>
          Floating content anchored to the trigger.
        </PopoverDescription>
      </PopoverContent>
    </Popover>
  )
}
```

## API

### Popover

Base UI Popover root.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `open` | boolean | — |  |
| `onOpenChange` | (open: boolean) => void | — |  |

## See also

- [HTML page](https://ui.anuragroy.dev/component/popover): Preview and the same docs in the site chrome.
- [Registry item](https://ui.anuragroy.dev/r/popover.json): Source files and dependencies.
- [Catalog](https://ui.anuragroy.dev/component): All components.
- [llms.txt](https://ui.anuragroy.dev/llms.txt): Agent index for this library.
