---
title: "Popover"
description: "A panel that opens from a button and stays until people close it. It holds content they can use, such as a share link, filters, or a short form."
url: https://gelatinui.com/components/popover
markdown_url: https://gelatinui.com/components/popover.md
access: free
install: "npx shadcn@latest add @gelatin-ui/popover"
registry_item: https://gelatinui.com/r/popover.json
version: "2026-11-08"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Popover

> A panel that opens from a button and stays until people close it. It holds content they can use, such as a share link, filters, or a short form.

Page: https://gelatinui.com/components/popover

## When to use it

Best for: A panel that opens from a button and holds interactive content: a share link, filters, a short form.

- Use it for interactive content that must stay near its button.
- Use `PopoverTitle` and `PopoverDescription` to name and describe the panel.
- Use `arrow`, `backdrop`, `showCloseButton`, and `padding` on `PopoverContent` to change the look.
- Use `createPopoverHandle` to open one popover from several detached triggers.

## When not to use it

- For a short label on hover, use a [Tooltip](https://gelatinui.com/components/tooltip.md).
- For a list of actions, use a Menu.
- For a task that blocks the page, use a [Dialog](https://gelatinui.com/components/dialog.md).
- For a panel from an edge of the screen, use a [Drawer](https://gelatinui.com/components/drawer.md).

## Notes for agents

- Render a Button through `render` on `PopoverTrigger`, such as `render={<Button />}`.
- `PopoverClose` has no look of its own. Render a Button through `render`.
- For the icon button in the corner, set `showCloseButton` on `PopoverContent`. Translate it with `closeLabel`.
- `modal` is off by default, so the page stays usable while the popover is open.
- `PopoverContent` is 288px wide by default. `padding="tight"` makes it as wide as its content.
- Long content scrolls in an inner box, so the close button and the arrow stay in place.
- `PopoverViewport` is only for one popover that moves between several triggers.

## Anatomy

```text
Popover
├─ PopoverTrigger (0..n)
├─ PopoverContent (0..n)
├─ PopoverHeader (0..n)
├─ PopoverTitle (0..n)
├─ PopoverDescription (0..n)
├─ PopoverFooter (0..n)
├─ PopoverClose (0..n)
└─ PopoverViewport (0..n)
```

## API reference

### Popover

Also takes every prop of Base UI `Popover.Root`: https://base-ui.com/react/components/popover

### PopoverTrigger

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |

Also takes every prop of Base UI `Popover.Trigger`: https://base-ui.com/react/components/popover

### PopoverContent

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `arrow` | `boolean` | false | Show an arrow that points at the trigger. The gap grows from 4px to 8px. |
| `backdrop` | `boolean` | false | Put a clear layer under the popup (Base UI `Popover.Backdrop`), for example to dim it. |
| `showCloseButton` | `boolean` | false | Show a close button (a 24px ghost icon button) 10px from the top and the end. |
| `padding` | `"default" \| "none" \| "tight"` | "default" | `default`: radius 14, 12px padding and 10px between the parts, 288px wide. `tight`: 4px padding and 4px between the parts, as wide as the content: a row of 28px actions (a plain Toolbar) with the 4px inset of the bar recipe, 38px high (the selection pill of the Quote Reply). `none`: no padding and no gap, as wide as the content: a panel that lays out its own parts edge to edge (a head with a rule, a scroll box, a docked composer: the Chat Popup). Give it a width and a height with layout classes; the body fills that height. |
| `portalProps` | `Omit` |  | Other Base UI props of the inner parts. A `className` here adds to the component classes. |
| `positionerProps` | `PopupPartProps` |  |  |
| `backdropProps` | `PopupPartProps<PopoverBackdropProps>` |  |  |
| `arrowProps` | `PopupPartProps<PopoverArrowProps>` |  |  |
| `closeButtonProps` | `PopupPartProps` |  |  |
| `closeLabel` | `string` | "Close" | The accessible name of the close button. Translate it with the page. |

Also takes every prop of Base UI `Popover.Popup`: https://base-ui.com/react/components/popover

### PopoverHeader

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### PopoverTitle

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |

### PopoverDescription

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |

### PopoverFooter

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### PopoverClose

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |

### PopoverViewport

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |

Also takes every prop of Base UI `Popover.Viewport`: https://base-ui.com/react/components/popover

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| PopoverTrigger | `popover-trigger` | `data-disabled` |  |  |
| PopoverContent | `popover-content` |  | `--available-height`, `--available-width`, `--radius` |  |
| PopoverHeader | `popover-header` |  |  |  |
| PopoverTitle | `popover-title` |  |  |  |
| PopoverDescription | `popover-description` |  |  |  |
| PopoverFooter | `popover-footer` |  |  |  |
| PopoverClose | `popover-close` | `data-disabled` |  |  |
| PopoverViewport | `popover-viewport` |  |  |  |

## Usage

Render a Button through `render` on `PopoverTrigger`. `showCloseButton` adds the close icon in the corner.

The sample also uses `button`, which this add does not write. One command adds them with this item:

```bash
npx shadcn@latest add @gelatin-ui/popover @gelatin-ui/button
```

```tsx title="seats-note.tsx"
import { Button } from "@/components/ui/button";
import {
  Popover,
  PopoverContent,
  PopoverDescription,
  PopoverHeader,
  PopoverTitle,
  PopoverTrigger,
} from "@/components/ui/popover";

export function SeatsNote() {
  return (
    <Popover>
      <PopoverTrigger render={<Button variant="outline" />}>Seats</PopoverTrigger>
      <PopoverContent>
        <PopoverHeader>
          <PopoverTitle>Seats</PopoverTitle>
          <PopoverDescription>Each member uses one seat. Guests are free.</PopoverDescription>
        </PopoverHeader>
      </PopoverContent>
    </Popover>
  );
}
```

## Compose

Rules:

- Sheets on phones (`phone-sheets`): Show a dialog or a large popover as a bottom sheet on a small screen.
- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui/popover
```

It adds 16 registry items: 13 files, 2423 lines, and the npm packages `@base-ui/react`, `@phosphor-icons/react`, `clsx`, `tailwind-merge`, `tailwind-variants`.

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Dialog](https://gelatinui.com/components/dialog.md): Pick Dialog for a task that blocks the page and needs the full attention of the user.
- [Tooltip](https://gelatinui.com/components/tooltip.md): Pick Tooltip for a short text label of a control on hover and focus, with no link or control inside.
- [Drawer](https://gelatinui.com/components/drawer.md): Pick Drawer for a large panel that slides in from an edge of the screen, often on a phone.
- [Hover Card](https://gelatinui.com/components/hover-card.md): Pick Hover Card for a rich preview of a link, such as a profile, that opens on hover and focus.

## Keyboard

| Keys | Action |
| --- | --- |
| Enter, Space | On the trigger, opens the popover. Focus moves to the first focusable element. |
| Tab | Moves focus to the next element. |
| Escape | Closes the popover. Focus returns to the trigger. |

## Accessibility

It is a Base UI Popover. `PopoverTitle` and `PopoverDescription` name and describe the popup.

Focus moves into the popup when it opens. Escape closes it, and focus goes back to the trigger.

It is not modal by default, so the page stays usable while it is open.

## Motion

| Part | Motion |
| --- | --- |
| Open | popup · 150ms · ease-panel (0.2, 0.4, 0.2, 1) · fades in and scales from 95% |
| Close | popup-exit · 120ms · ease-out (0, 0, 0.2, 1) |
