Skip to content

Popover

An anchored popover on Base UI Popover.

For a little more detail or a small form tied to one control. It does not block the page: a click outside closes it, and so does moving focus away.

Default

With a form

Placement

Installation

npx shadcn@latest add @khaeli/popover

Install @khaeli/foundation first: this item's styling lives in its tokens and [data-slot] rules.

Installs with

Registry items
npm packages
  • @base-ui/react ^1.7.0

Keyboard

EnterSpace
On the trigger, opens the popover. Focus moves to the first field or button inside it, or to the popover itself when it has neither.
Tab
Moves through the controls inside. After the last one focus goes on to the next control on the page and the popover closes.
Escape
Closes the popover and returns focus to the trigger.

Accessible name

  • The popover has the role dialog. It is named by PopoverTitle and described by PopoverDescription; without a title give PopoverContent an aria-label.
  • The trigger takes your button through render and says that it opens a dialog and whether it is open (aria-haspopup, aria-expanded). Its name is the button's text.
  • side and align are where the popover would like to open. It moves to another side when that one has no room.

Registry JSON

The item as the shadcn CLI reads it, with every file it ships: https://ui.khaeli.com/r/popover.json