PopoverNew
A small panel that belongs to a button: it rises off the trigger from the nearest point, flips to fit, and hands focus to what is inside.
Used forQuick editsShare settingsFiltersDetails on demand
Install with the shadcn CLI
Older shadcn CLI, or a network that blocks ui.shadcn.com? Install by URL: shadcn add https://hairlineui.com/r/popover.json. More
Templates
Need the whole page?
65 Next.js landing pages, each designed from scratch. Try any of them live; one is $39, all of them $159, and 8 are free.
Where it’s used
Quick edits
Rename a file or set a due date without leaving the list.
Share settings
A link with access options under a Share button.
Filters
A few fields behind a Filter button.
Details on demand
More about a plan, a user or a status.
What it handles for you
Positioning, focus handover, Escape and outside presses are where most popovers go wrong; this one does all four.
From the trigger
transform-origin is the point on the trigger nearest the panel.
Stays in view
Flips sides and shifts; follows scroll and resize.
Focus handover
In to the first field, back to the trigger on Escape.
Close from inside
children can be a function that receives close().
Overview
Popovers often appear from nowhere, cover their trigger and leave focus behind. This one rises off its trigger from the point nearest to it, flips and shifts to stay in the window, moves focus to the first field inside, and on Escape gives focus back to the trigger. For a list of actions, use the dropdown menu.
States
- open
- Rises 6px from its side, out of a 4px blur, from 0.96 (320ms).
- inside
- Focus on the first field or the panel.
- close
- Escape returns focus to the trigger; a press outside just closes (180ms).
Usage
Depends on lucide-react, installed for you by the CLI along with the keyframes it needs.
Props
- trigger
- ReactElement
- The button; it gets aria-expanded and the click.
- children
- ReactNode | ({ close }) => ReactNode
- The content.
- side / align= "bottom" / "center"
- Side / Align
- Where it sits.
- open / onOpenChange
- boolean / (open) => void
- Control it.
- width= 280
- number
- Panel width.
- label
- string
- Accessible name of the panel.
Accessibility and motion
- Placement, presence and dismissal live in floating.ts, shared by tooltip, popover, dropdown and context menus: they all flip, shift, enter and leave the same way.
- The panel is role="dialog"; the trigger gets aria-haspopup and aria-expanded.
- Reduced motion: it fades.
Requirements
React 19, Tailwind CSS v4 and shadcn/ui theme variables (any style, light and dark). Icons from lucide-react.
Source
Registry item: /r/popover.json


