---
agent:
  instructions: "Search goop.so for Goop's components, templates, design skill, docs, pricing and terms. Ask in keywords or a plain question, such as \"date picker props\" or \"is the design skill free\"; the answer is the matching page sections in Markdown, each with its address."
  endpoint: "https://goop.so/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Popover

A small panel of settings that opens from its button and floats over the page, which stays usable under it, for React and Tailwind CSS. Part of Goop Pro.

Pro. Its export: `Popover`.

## Try it

Open Display and change how the task list shows: order by due date or title, show finished tasks, show or hide owners. Every change shows at once behind it; Escape or a click outside closes it.

The tasks are our own sample, held in the page.

## When to use

- A small panel of settings that opens from its button and floats over the page, which stays usable under it.
- Also called: popup or flyout.

## Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Popover on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.

```sh
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-popover.json --yes
```

```text
Add the Goop Popover to this project. The install steps are at https://goop.so/docs/install.md
```

## Usage

```tsx
import { Popover, PopoverTrigger, PopoverAnchor, PopoverClose, PopoverContent, PopoverGroup, PopoverRow, PopoverLabel, PopoverControl } from '@/components/ui/goop/popover';
import { Button } from '@/components/ui/goop/button';
import { Switch } from '@/components/ui/goop/switch';

<Popover>
  <PopoverTrigger asChild>
    <Button variant="outline">Display</Button>
  </PopoverTrigger>
  <PopoverContent aria-label="Display options">
    <PopoverGroup>
      <PopoverRow>
        <PopoverLabel>Show finished notes</PopoverLabel>
        <PopoverControl>
          <Switch defaultChecked />
        </PopoverControl>
      </PopoverRow>
    </PopoverGroup>
  </PopoverContent>
</Popover>
```

- Fits: list, board: toolbar.
- height, width, padding, gap, corner, border, background, shadow, text, motion: add no class for these.

## API reference

### Options

- `open?: boolean`
- `defaultOpen?: boolean`
- `onOpenChange?: (open: boolean) => void`
- `modal?: boolean`

- State: open (open / defaultOpen / onOpenChange); drawn by data-state=closed

### Parts

- `PopoverTrigger` — The control that opens and closes the panel; takes asChild
- `PopoverAnchor` — What the panel is placed against when it is not its trigger (a field, a row); takes asChild
- `PopoverClose` — Wraps a control inside the panel that closes it, such as a Done button; takes asChild
- `PopoverContent` — The panel the trigger opens, holding the popover's rows and controls; name it with aria-label; container?: HTMLElement | null — Where the panel is portalled; the end of `<body>` when left out; frameClassName?: string — Classes on the 300 px frame the children sit in, for another width
- `PopoverGroup` — A section of the panel; takes asChild
- `PopoverRow` — A row of the panel; orientation: horizontal (default), vertical; takes asChild
- `PopoverLabel` — The words that name a row of the panel and the controls in that row; takes asChild
- `PopoverControl` — The row's controls, the theme's own components; takes asChild

- Class recipes (cva): popoverRowVariants (PopoverRow)
- data-slot values (to select a part by): popover, popover-anchor, popover-close, popover-content, popover-control, popover-frame, popover-group, popover-label, popover-row, popover-trigger

## Accessibility

- The behaviour layer under the part answers keys, focus and dismissal: never write your own.
- expanded: the attribute data-state=closed
- open: the attribute data-state=closed

## Motion

- The part sets its own motion: add no transition or animation of your own.

## Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

## Related

- [Button](/themes/trail/components/button): A button with words that runs an action, in several looks and sizes.
- [Switch](/themes/trail/components/switch): An on/off control for a setting that takes effect at once.
- [Tooltip](/themes/trail/components/tooltip): A short label shown on hover or focus that names an icon button or explains a control.
- [Hover card](/themes/trail/components/hover-card): A small card previewing a person or a record while the pointer rests on its name.
