Popover
A small panel anchored to its trigger, for quick tasks that don't deserve a dialog. It grows out of the trigger on a spring and is dismissed with Escape or a click outside.
Install
npx shadcn@latest add @nelumbo/popoverShare a link
A header with a title and a sentence, then the task. Focus moves into the popover and returns to the trigger when it closes.
A small form
For a couple of fields that change something in place.
Picker
Popovers suit pickers: choose, and it closes.
Placement
side and align place it; it flips and shifts to stay on screen.
Usage
import { Popover, PopoverTrigger, PopoverContent, PopoverHeader, PopoverTitle, PopoverDescription } from "@/components/ui/popover"<Popover> <PopoverTrigger asChild><Button>Share</Button></PopoverTrigger> <PopoverContent> <PopoverHeader> <PopoverTitle>Share link</PopoverTitle> <PopoverDescription>Anyone with the link can view.</PopoverDescription> </PopoverHeader> … </PopoverContent></Popover>Props
Other props go to Radix Popover (open, onOpenChange, modal, side, alignOffset…).
| Prop | Type | Default | Notes |
|---|---|---|---|
align | "start" | "center" | "end" | "center" | |
sideOffset | number | 6 | Gap to the trigger |
collisionPadding | number | 8 | Keeps it this far from the viewport edge |