Img
Lazy image with ratio, placeholder, error
An image that reserves its space, shows a skeleton or a blurred placeholder while it loads, and a marked fallback if it fails. alt is required: describe what the image shows, or pass alt="" for decoration.
Basic

ratioholds the space before load, so nothing jumps.loading="eager"for the image at the top of the page.- A broken image shows the error mark, named by
alt, instead of the browser's broken-image icon.
Usage
ts
import { BlessImg } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
src* | string | — | |
alt* | string | — | |
ratio | string | number | — | e.g. 16 / 9 or "4 / 5"; omit to use the image's own |
fit | "fill" | "none" | "cover" | "contain" | "cover" | |
loading | "lazy" | "eager" | "lazy" | eager for above-the-fold images |
placeholder | string | — | tiny blurred placeholder (data URL / LQIP) |
srcset | string | — | |
sizes | string | — |
Slots
| Name | Scope | Description |
|---|---|---|
error | — | |
default | — |