Skip to contentKino
Skip to Content

Popover

A popover that grows out from under its trigger and folds back into it.

npx shadcn add https://kinoui.com/r/popover.json
Share on

Examples

Default

It grows out from under its trigger, as wide as the trigger at first, and folds back into it.

Sides

Pick where it opens with side and align. It still grows from where its trigger is.

Open on hover

With openOnHover, it also opens when the pointer rests on the trigger for 200ms, and what is inside stays usable.

With a form

Focus moves to the first control inside when it opens.

Retention period

Icon trigger

A trigger with only an icon needs an aria-label.

Long content

Content taller than the space left on screen scrolls inside the box.

Width

It is w-72 unless you set a width with className.

Installation

npx shadcn@latest add https://kinoui.com/r/popover.json
Files
lib/reduce-motion.tslib/scroll.tslib/popup.tscomponents/kino/popover.tsx
Packages
@base-ui/react

New to Kino? Installation covers what your project needs first and the @kino namespace.

API reference

Popover

PropTypeDefaultDescription
defaultOpenbooleanfalseWhether it is open at first, when you leave the state to the popover.
openbooleanNoneWhether it is open, when you hold the state.
onOpenChange(open, details) => voidNoneCalled when it opens or closes.

PopoverTrigger

PropTypeDefaultDescription
openOnHoverbooleanfalseWhether it also opens when the pointer rests on the button. A press still opens it.
delaynumber200With openOnHover, how long the pointer rests on the button before the popover opens, in milliseconds.
closeDelaynumber0With openOnHover, how long it waits after the pointer leaves before it closes, in milliseconds.

PopoverContent

PropTypeDefaultDescription
side'left''top''bottom''right''inline-start''inline-end''bottom'The side of the trigger it opens on. It moves to another side when there is no room.
align'start''center''end''center'How it lines up with the trigger along that side.
sideOffsetnumberfunction6The gap between it and the trigger, in pixels.
alignOffsetnumberfunction0How far it shifts along the side, in pixels.
classNamestringNoneGoes to the content inside the box: w-72, with padding and a gap, unless you set others.

Accessibility

  • Focus moves to the first control inside when it opens, and back to the trigger when it closes.
  • Escape or a press outside closes it.
  • With openOnHover, the keyboard still opens it with Enter or Space, so nothing is reachable by hover alone.
  • A PopoverTitle names the popover for a screen reader.
  • When the system asks for less motion, the popover only fades.