---
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 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 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>/meadow-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 { PopoverAnchor, PopoverClose } from '@/components/ui/goop/popover';

import { Button } from '@/components/ui/goop/button';
import { Checkbox } from '@/components/ui/goop/checkbox';
import {
  Command,
  CommandInput,
  CommandItem,
  CommandList,
  CommandPopover,
  CommandPopoverContent,
  CommandPopoverTrigger,
} from '@/components/ui/goop/command';
import {
  Popover,
  PopoverContent,
  PopoverControl,
  PopoverGroup,
  PopoverLabel,
  PopoverRow,
  PopoverTitle,
  PopoverTrigger,
} from '@/components/ui/goop/popover';
import { useState } from 'react';

function CalendarFilter() {
  const [on, setOn] = useState(true);
  const mark = <Checkbox checked={on} tabIndex={-1} className="pointer-events-none" />;
  return (
    <CommandPopover>
      <CommandPopoverTrigger asChild><Button variant="outline">Calendars</Button></CommandPopoverTrigger>
      <CommandPopoverContent aria-label="Calendars" closeOnSelect={false} className="w-55">
        <Command label="Calendars">
          <CommandInput placeholder="Search" shortcut="O" />
          <CommandList>
            <CommandItem aria-checked={on} onSelect={() => setOn(!on)} mark={mark}>Field visits</CommandItem>
          </CommandList>
        </Command>
      </CommandPopoverContent>
    </CommandPopover>
  );
}

function ShareLinks({ onCopy, onCreate }: { onCopy(): void; onCreate(): void }) {
  return (
    <Popover>
      <PopoverTrigger asChild><Button>Share</Button></PopoverTrigger>
      <PopoverContent variant="menu" aria-labelledby="share" frameClassName="w-70">
        <PopoverTitle id="share">Share links</PopoverTitle>
        <PopoverGroup>
          <PopoverRow>
            <PopoverLabel>Ines visit</PopoverLabel>
            <PopoverControl><Button variant="ghost" onClick={onCopy}>Copy</Button></PopoverControl>
          </PopoverRow>
          <Button variant="success" size="row" className="w-full" onClick={onCreate}>Create link</Button>
        </PopoverGroup>
      </PopoverContent>
    </Popover>
  );
}
```

- Fits: list, board: toolbar.
- height, width, padding, gap, corner, border, background, 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=open

### Parts

- `PopoverTrigger` — The control that opens and closes the panel
- `PopoverAnchor` — What the panel is placed against when it is not its trigger (a field, a row); it adds no look of its own, and with `asChild` no element either
- `PopoverClose` — Wraps a control inside the panel that closes it, such as a Done button
- `PopoverContent` — The panel the trigger opens (a `dialog`: name it with `aria-label`, or `aria-labelledby` pointing at its `PopoverTitle`), below its trigger at its start, 8 px off (`side`, `align`, `sideOffset` move it), in a portal — the end of `<body>`, or `container`
- `PopoverTitle` — The panel's heading, its first child (an `h2`; `asChild` puts the look on the caller's own heading for another level)
- `PopoverGroup` — A section of the panel (a field, a list, a run of rows)
- `PopoverRow` — A row of a section
- `PopoverLabel` — The words that name a row of the panel and the controls in it (as a group, and its one control)
- `PopoverControl` — The row's controls, the theme's own components, in the order written (the tab order)

- Class recipes (cva): popoverContentVariants (PopoverContent), popoverRowVariants (PopoverRow)

### PopoverAnchor

What the panel is placed against when it is not its trigger (a field, a row); it adds no look of its own, and with `asChild` no element either.

```tsx
import { PopoverAnchor } from '@/components/ui/goop/popover';
```

### Options

- Also takes: asChild?: boolean

### PopoverClose

Wraps a control inside the panel that closes it, such as a Done button.

```tsx
import { PopoverClose } from '@/components/ui/goop/popover';
```

### Options

- Also takes: asChild?: boolean

### PopoverContent

The panel the trigger opens (a `dialog`: name it with `aria-label`, or `aria-labelledby` pointing at its `PopoverTitle`), below its trigger at its start, 8 px off (`side`, `align`, `sideOffset` move it), in a portal — the end of `<body>`, or `container`.

```tsx
import { PopoverContent } from '@/components/ui/goop/popover';
```

### Options

- variant: default (default), menu
- container?: HTMLElement | null — Where the panel is portalled; the end of `<body>` when left out.
- frameClassName?: string — Classes added last on the 208 px column the children sit in, for a panel that needs another width.

### PopoverControl

The row's controls, the theme's own components, in the order written (the tab order).

```tsx
import { PopoverControl } from '@/components/ui/goop/popover';
```

### Options

- Also takes: asChild?: boolean

### PopoverGroup

A section of the panel (a field, a list, a run of rows).

```tsx
import { PopoverGroup } from '@/components/ui/goop/popover';
```

### Options

- Also takes: asChild?: boolean

### PopoverLabel

The words that name a row of the panel and the controls in it (as a group, and its one control).

```tsx
import { PopoverLabel } from '@/components/ui/goop/popover';
```

### Options

- Also takes: asChild?: boolean

### PopoverRow

A row of a section.

```tsx
import { PopoverRow } from '@/components/ui/goop/popover';
```

### Options

- orientation: horizontal (default), vertical
- Also takes: asChild?: boolean

### PopoverTitle

The panel's heading, its first child (an `h2`; `asChild` puts the look on the caller's own heading for another level).

```tsx
import { PopoverTitle } from '@/components/ui/goop/popover';
```

### Options

- Also takes: asChild?: boolean

### PopoverTrigger

The control that opens and closes the panel.

```tsx
import { PopoverTrigger } from '@/components/ui/goop/popover';
```

### Options

- Also takes: asChild?: boolean

## Keyboard

- Enter: on the trigger: open, the focus on the panel's first control
- Space: on the trigger: open, the focus on the panel's first control
- Tab / Shift+Tab: move through the panel's controls

## Accessibility

- The behaviour layer under the part answers keys, focus and dismissal: never write your own.

## 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.

Shortened to fit: the data-slot values; what else went is in agent/ship/manifest.json.

## Related

- [Button](/themes/meadow/components/button): A button with words that runs an action, in several looks and sizes, on a page, in a row or in a sidebar.
- [Checkbox](/themes/meadow/components/checkbox): A round box a person ticks to mark one thing done or chosen.
- [Command](/themes/meadow/components/command): A list of actions or options narrowed by typing.
- [Tooltip](/themes/meadow/components/tooltip): A short label shown on hover or focus that names an icon button or explains a control.
