Popover
A small panel beside the button that opened it, for quick changes without leaving the page.
When to use it
Use Popover for small changes next to their button: sharing, filters, a quick edit. The page stays usable, so it can close the moment people click away.
If the task needs full attention or has several steps, use a Dialog.
PopoverThis page
The page stays usable.
Small changes next to their button.
How it behaves
Use render={<Button />} on PopoverTrigger. Focus moves into the popup and returns to the trigger; Escape and outside presses close it.
PopoverHeader, PopoverTitle, and PopoverDescription name the panel for assistive technology. Content can hold fields and actions, unlike Tooltip.
PopoverContent accepts side, align, and offsets. It scales in from its trigger over 150ms, fits the available height, and opens immediately from the keyboard.
Use Dropdown Menu for a list of actions and Dialog for a task that needs the whole screen.
Build it
Add it with the shadcn CLI:
1pnpm dlx shadcn@latest add https://jzbui.com/r/popover.jsonA complete example. Change the values to fit your product:
1234567891011121314import { Button } from "@/components/ui/button"import { Input } from "@/components/ui/input"import { Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger } from "@/components/ui/popover"
<Popover> <PopoverTrigger render={<Button variant="outline" />}>Share</PopoverTrigger> <PopoverContent align="end"> <PopoverHeader> <PopoverTitle>Share project</PopoverTitle> <PopoverDescription>Anyone in the workspace with the link can view it.</PopoverDescription> </PopoverHeader> <Input readOnly aria-label="Project link" defaultValue="https://example.com/p/website-refresh" /> </PopoverContent></Popover>The full source is yours to edit once installed: