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

Figure ​

An image with a caption and a credit

Puts a picture in the text of an article. For many pictures, use the gallery.

Basic
A pink placeholder with the number 1
The vocal booth after the new panels went up. The echo time dropped by half.Photo: Ana Putri
  • src and alt are required. The alt text says what the picture shows. The caption does not replace it, because the caption often adds context and not a description.
  • caption is the text under the picture. For rich text, use the default slot.
  • credit names who made the picture, such as "Photo: Ana Putri". With creditHref, it is a link to the source.
  • width is normal (default), wide, or full. On wide screens, wide grows past the text column a little. On phones it stays in the column, so the page never scrolls sideways.
  • The markup is a native figure with a figcaption.
  • Change the words with labels or a label pack: credit (a function).

Usage ​

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

API ​

Props

NameTypeDefaultDescription
src*string—
alt*string—what the picture shows; the caption does not replace it
captionstring—
creditstring—who made the picture
creditHrefstring—a link to the source of the picture
width"full" | "normal" | "wide""normal"`wide` grows past the text column a little, `full` takes the whole width
labelsPartial<{ credit: (who: string) => string; }>—

Slots

NameScopeDescription
default—

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