Skip to content

Popover ​

Popover API panel

Extra content next to the thing that opens it — a small form, details, a colour 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> when it meets a <div>, so a trigger placed inside a paragraph renders differently on the server and the client. Wrap with <span>/<div> instead.

  • A click on the trigger opens it; the trigger is told what it opens and whether it's 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.

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.