Skip to content
Eskais UI

Overlays

Popover

UI SDK Popover parts on a glass-ready surface: focus moves in, Escape and outside presses close it, focus returns to the trigger.

Example

Installation

npx shadcn@latest add @eskais/popover
Brings alongbuttontooltip
npm packagesclass-variance-authority@0.7.1

Usage

Import
import {  Popover,  PopoverArrow,  PopoverClose,  PopoverContent,  PopoverDescription,  PopoverTitle,  PopoverTrigger,  createPopoverController,  floatingSurfaceClassName,} from "@/components/ui/popover"

API reference

PopoverTrigger

Takes every prop of UI SDK PopoverTrigger except aria-label, ButtonLookProps.

PopoverClose

Takes every prop of UI SDK PopoverClose except aria-label, ButtonLookProps.

Other exports

createPopoverControllerfloatingSurfaceClassNametype PopoverProps

Accessibility

  • Focus moves in, Escape and outside presses close it, focus returns to the trigger.
  • Named by PopoverTitle.
  • openOnHover (with delay and closeDelay) also opens it when the pointer rests on the trigger, leaving focus where it was; the pointer can cross into it. A press, Enter, Space and a tap still open it, and keyboard focus alone doesn't, so tabbing past never pops one open.
  • Open from the start inside a dialog, it stays open while the dialog takes its initial focus.

Agent actions

Agents open it by its trigger's name, hover or not, and read or press what's inside.

Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.