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
srcandaltare required. Thealttext says what the picture shows. The caption does not replace it, because the caption often adds context and not a description.captionis the text under the picture. For rich text, use the default slot.creditnames who made the picture, such as "Photo: Ana Putri". WithcreditHref, it is a link to the source.widthisnormal(default),wide, orfull. On wide screens,widegrows past the text column a little. On phones it stays in the column, so the page never scrolls sideways.- The markup is a native
figurewith afigcaption. - Change the words with
labelsor a label pack:credit(a function).
Usage
ts
import { BlessFigure } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
src* | string | — | |
alt* | string | — | what the picture shows; the caption does not replace it |
caption | string | — | |
credit | string | — | who made the picture |
creditHref | string | — | 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 |
labels | Partial<{ credit: (who: string) => string; }> | — |
Slots
| Name | Scope | Description |
|---|---|---|
default | — |