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

Annotator ​

Draw boxes and drop pins on an image, and get the regions back

For review, labeling and feedback: mark what is wrong in a screenshot, outline the objects in a photo, point at a spot in a plan. The result is a list of regions you can store and draw again at any size. To show fixed pins with popovers use Hotspots. To crop, Cropper.

Review marks
A news page

2 marks, saved as fractions of the image.

  • v-model is the marks: { id, x, y, w?, h?, label }, every number a fraction of the image (0–1), so they fit the picture at any size. A mark with w and h is a box, without them a pin.
  • Pick a tool (v-model:tool): Box drags out a rectangle (a tiny flick is ignored), Pin drops a pin where you click, Select only selects. A new mark is selected and focus goes to its Name field. Drag a mark to move it, the corner square to resize a box. They stop at the image edge.
  • Keyboard: marks are focusable (one tab stop). arrows move by 1% (Shift: 5%), Alt+arrows resize a box, Enter goes to its name, Delete removes it and focus lands on a neighbor. Add at center creates a mark with no pointer, and the list under the image selects any mark. Every change is announced.
  • :editable="false" shows and selects but changes nothing. labels translates the wording and regionName(kind, n, label) writes each mark's spoken name.

Usage ​

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

API ​

Props

NameTypeDefaultDescription
src*string—
altstring""
editablebooleantrueoff: the marks are shown and selected, nothing is drawn, moved or removed
labelstring"Annotated image"
labelsPartial<{ tools: string; select: string; box: string; pin: string; add: string; remove: string; name: string; regions: string; regionName: (kind: "box" | "pin", n: number, label: string) => string; added: (name: string) => string; removed: (name: string) => string; moved: (x: number, y: number) => string; hint: string; }>—
modelValueRegion[][]the marks, as fractions of the image
selectedstring | nullnull
tool"select" | "box" | "pin""box"what a drag or click on the empty image does

Events

NamePayloadDescription
update:modelValue[value: Region[]]
update:selected[value: string | null]
update:tool[value: "select" | "box" | "pin"]

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