npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-popover.json --yesPopover
ProA 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.
What an agent sees
- PopoverTriggerThe control that opens and closes the panel
- PopoverAnchorWhat the panel is placed against when it is not its trigger (a field, a row)
- PopoverCloseWraps a control inside the panel that closes it, such as a Done button
- PopoverContentThe panel the trigger opens, holding the popover's rows and controls
- PopoverGroupA section of the panel
- PopoverRowA row of the panel
- PopoverLabelThe words that name a row of the panel and the controls in that row
- PopoverControlThe row's controls, the theme's own components
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>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.
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-popover.json --yesAdd the Goop Popover to this project. The install steps are at https://goop.so/docs/install.mdUsage
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
| Option | Type | What it does |
|---|---|---|
| open? | boolean | |
| defaultOpen? | boolean | |
| onOpenChange? | (open: boolean) => void | |
| modal? | boolean |
- State: open (open / defaultOpen / onOpenChange); drawn by data-state=closed
| Part | What it is |
|---|---|
| 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.
Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:
| State | Drawn by |
|---|---|
| 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.
- How the theme moves, and how to move your own parts the same way: Motion.
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.