Shadcn Popover
React popover for settings panels, filters, and inline forms. Built with TypeScript and Tailwind CSS for Next.js using Base UI — click to open, no focus trap.
The shadcn popover is a panel that opens from a click and stays until you click outside or press Escape. Use it for a short form, a filter, or extra controls next to a button. A phrase is a Tooltip. Blocking the page is a Dialog.
Looking for a neobrutalism version for shadcn?
Same popover, thicker borders. The NeoBrutalism popover is the kit if you want that look.
Usage
import { Button } from "@/components/ui/button"
import {
Popover,
PopoverContent,
PopoverDescription,
PopoverHeader,
PopoverTitle,
PopoverTrigger,
} from "@/components/ui/popover"<Popover>
<PopoverTrigger render={<Button variant="outline" />}>
Open Popover
</PopoverTrigger>
<PopoverContent>
<PopoverHeader>
<PopoverTitle>Title</PopoverTitle>
<PopoverDescription>Description text here.</PopoverDescription>
</PopoverHeader>
</PopoverContent>
</Popover>render={<Button />} keeps the Button as the trigger. align defaults to center. sideOffset is 4.
Composition
PopoverAnchor is optional — position against something other than the trigger.
Basic
Header, title, description. align="start" pins the panel to the leading edge.
Align
align on PopoverContent is start, center, or end.
With Form
Fields stay next to the trigger. The rest of the page is still live.
RTL
Wrap with DirectionProvider and dir="rtl". Physical side values stay left and right.
API
Prop
Type
PopoverContent
Prop
Type
PopoverTrigger and PopoverAnchor take render. PopoverHeader, PopoverTitle, and PopoverDescription take className.
Keyboard
| Key | Action |
|---|---|
Space / Enter | Open or close from the trigger |
Tab / Shift + Tab | Next / previous focusable control |
Escape | Close and return focus to the trigger |
Focus is not trapped. Tab can leave the panel.
Notes
Keep the panel short. A long workflow is a Dialog.
With other components
Trigger for the panel
FieldLabel stacked with input
InputWidth, height, filters
CalendarPick a date
CommandSearchable list
SeparatorSplit header from fields
Questions
Related
Was this page helpful?
Sign in to leave feedback.
Pagination
React pagination for search results and data tables. Built with TypeScript and Tailwind CSS for Next.js using Base UI — previous, next, page links, and ellipsis.
Progress
React progress for uploads, form steps, and long-running tasks. Built with TypeScript and Tailwind CSS for Next.js using Base UI — a track that fills as value moves.