Popover
popoverA small surface anchored to a trigger, with a title and a description that Base UI wires into the accessibility tree so the popover is announced with a name. Collision-aware placement, portalled so it escapes overflow, and a Close part for the explicit way out.
import {
Popover,
PopoverClose,
PopoverContent,
PopoverDescription,
PopoverTitle,
PopoverTrigger,
} from "@/components/forme/popover/popover";
import { Button } from "@/components/forme/button/button";
export function PopoverDemo() {
return (
<Popover>
<PopoverTrigger asChild>
<Button variant="secondary">What is this?</Button>
</PopoverTrigger>
<PopoverContent>
<PopoverTitle>Environments</PopoverTitle>
<PopoverDescription>
Previews are built for every branch and kept for seven days before they are removed.
</PopoverDescription>
<PopoverClose className="mt-3 inline-block">Got it</PopoverClose>
</PopoverContent>
</Popover>
);
}Install
Adds the component, its registry dependencies, and the token stylesheet you import once.
Usage
import {
Popover, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger,
} from "@/components/forme/popover/popover";
<Popover>
<PopoverTrigger asChild>
<Button variant="secondary">Share</Button>
</PopoverTrigger>
<PopoverContent>
<PopoverTitle>Share this view</PopoverTitle>
<PopoverDescription>Anyone with the link can see it.</PopoverDescription>
</PopoverContent>
</Popover>When to use
Reach for it
- Small interactive panels anchored to a control: a share box, a quick filter, a colour picker.
Use something else
- Content that blocks the page until it is handled — that is a
Dialog. - Plain text hints on hover; use a
Tooltip.
API reference
Read from the source, so it is the API of the file you install. A prop marked * is required.
PopoverTrigger
| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | — | Render as the single child element instead of a <button>, keeping the trigger behaviour. |
Also takes every prop of Base UI Popover.Trigger.
The other parts
PopoverTakes Base UIPopover.RootPopoverContentTakes Base UIPopover.PopupandPick<ComponentProps<typeof PopoverPrimitive.Positioner>, "side" | "sideOffset" | "align">PopoverTitleTakes Base UIPopover.TitlePopoverDescriptionTakes Base UIPopover.DescriptionPopoverCloseTakes Base UIPopover.Close
Accessibility
PopoverTitleandPopoverDescriptionmake it announced as a dialog with a name and a description.- Base UI moves focus in, closes on Esc and returns focus to the trigger.
Motion
- It grows from its trigger with a slight scale and blur, and exits faster than it enters.
Related


Tooltip
A short description of a control, shown on hover and on keyboard focus, with an optional arrow. Built on the Base UI primitive and portalled so a tooltip is never clipped by the toolbar or table it belongs to.
overlays

Dialog
A modal built on the Base UI primitive, so the focus trap, the inert background, Esc to close and the return of focus all come from one well tested place. The backdrop fades and the panel scales in, both in and out, and everything comes from the foundation tokens.
overlays

Drawer
A bottom sheet on the Base UI dialog, so it keeps the focus trap, Esc and focus return. Drag it down by the handle or header and it follows your finger, then springs back or closes when pulled past a third of its height or flicked.
overlays