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

Hotspots ​

Numbered pins on an image or diagram, with popovers

Point at parts of a picture (a product shot, a floor plan, an annotated screenshot) and say something about each. For a single anchored note, use a Popover. For a step-by-step walk through a page, a Tour.

Basic
The Blessing docs home page
click a pin
  • v-model is the list of pins: { id, x, y, label }, with x and y in percent of the stage, so the pins stay put when the image scales. Numbers follow the order of the list.
  • A pin is a button named by its number and its label, for example "1. Search". The name starts with the number on the pin, so voice control users can say it. Click it for a popover. #spot="{ spot, index }" fills the popover with anything, and the label is the text when you leave the slot out. One popover is open at a time. v-model:active reads or sets which.
  • Give it src and alt for an image, or fill the default slot with a diagram, an SVG or a screenshot of your own. Pins sit on top.
  • editable turns it into an editor. Click the stage to add a pin (it opens right away). Drag a pin to move it. To remove a pin, focus it and use the arrows (Shift for bigger steps) or Delete. add and remove fire with the pin.

Usage ​

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

API ​

Props

NameTypeDefaultDescription
srcstring—an image to pin onto; leave out and use the default slot for a diagram or anything else
altstring""
editableboolean—click the stage to add a pin, drag to move one, Delete to remove it, arrows to nudge it
placement"left" | "bottom" | "top" | "right""top"
modelValueS[][]
activeS["id"] | nullnullid of the pin whose popover is open

Events

NamePayloadDescription
add[spot: S]
remove[spot: S]
update:modelValue[value: S[]]
update:active[value: S["id"] | null]

Slots

NameScopeDescription
default—
spot{ spot: S; index: number; }

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