Skip to content
Preview
A gradient

Img

src
string
An address: a Blob goes through useAddress first (Next's types let an <img> take one).
fit
"cover" | "contain" | "fill" | "scale-down" | "none"
How the picture fits its box. Defaults to cover in a placeholder slot.
rootStyle
RootStyle
Typed StyleX override: where the image sits; in a slot, where the slot sits.
placeholder
string | null
Makes it a slot: what stands in the picture's box from the first frame until the picture has faded in over it, its placeholder's code (makePlaceholder) drawn as a blur of its colours, or null for the quiet skeleton. The Img then fills its nearest positioned box, and a picture that cannot be loaded says so there, with a way to try again.
ahead
boolean
Default: false
Fetched only once its place comes within about two windows of the view, either way, and first when in view.
still
boolean
Default: false
src moves and no still of it is given, so its first frame is drawn, named by alt, and it never plays.
style
CSSProperties
Inline geometry the image needs from data (an aspect ratio, the part of a cut picture it keeps).

Rest props go to <img> props.

State machine

PreviewThe picture has loaded.
Dusk over the bay