Skip to content
Calm motion: animations on this site only fade, with no movement

Popover ​

Popover API panel

Extra content next to the thing that opens it: a small form, details, a color picker. For a one-line hint use a Tooltip. For commands, a DropdownMenu.

Basic
Manual
Arrow

Not inside <p>

The floating panel is a <div>. HTML closes a <p> at a <div>. For this reason, a trigger placed inside a paragraph renders differently on the server and the client. Wrap it in a <span> or <div> instead.

  • A click on the trigger opens it. The trigger is told what it opens and whether it is open. Esc or a click outside closes it, and focus goes back to the trigger if it was inside.
  • modal turns off the click-outside close (Esc and your own control still close it). trigger="hover" opens on hover and focus, for previews only. See HoverCard.
  • title names it. arrow points its accent edge at the trigger.
  • A class or another attribute on BlessPopover goes on the panel, so you can style the panel from the parent.

Usage ​

ts
import { BlessPopover } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
placementPlacement"bottom"
offsetnumber—
trigger"click" | "hover" | "manual""click"trigger interaction
openDelaynumber300
closeDelaynumber200
modalboolean—no light dismiss: only Esc or your own control closes it
titlestring—
arrowboolean—the accent edge slides along to point at the trigger
openbooleanfalse

Events

NamePayloadDescription
update:open[value: boolean]

Slots

NameScopeDescription
trigger{ open: boolean; }
default{ close: () => boolean; }

Released under the MIT License. Character names and artwork belong to their owners.