Skip to documentation

ComponentsOverlays & menus

Popover

Shared primitive

Show a small interactive tool near its trigger.

@/components/ui/popover

Composition preview

Try Popover alongside its related overlays & menus components. These examples keep all actions local.

Native top-layer example

Existing imperative dialogs compose shadcn with the native top layer to retain cancellation guards and nested overlays.

Native dialog example

This closed dialog must not intercept Escape from another native modal.

Dormant dialog regression example

Usage

import { Popover, PopoverTrigger, PopoverContent } from "@/components/ui/popover";
import { Button } from "@/components/ui/button";

<>
<Popover>
  <PopoverTrigger asChild><Button variant="outline">Options</Button></PopoverTrigger>
  <PopoverContent aria-label="Options">Contextual controls</PopoverContent>
</Popover>
</>

Composition recipe. Supply application state, handlers and persistence in the owning product component. Inspect the installed source before extending its API.

API & composition

open/defaultOpen, onOpenChange; PopoverTrigger, PopoverContent, PopoverAnchor

Usage & accessibility

Provide a clear accessible name. Use Dialog when the task requires a modal workflow.

Implementation contract

src/components/ui/popover.tsx

Use named variants and semantic theme tokens. Preserve existing input values, refs, focus and cancellation behavior. Verify keyboard, narrow layouts and pending/error states when behavior changes.

V-2026-10-19_18.07.14