Skip to content

Image

A picture from a URL, or a placeholder box when it has none.

Group: Media · Kind: native

example
Cover
fit · contain
Cover
fit · fill
Cover
fit · none
Cover
fit · scaleDown
Cover

Open in the playground

The same specimen painted by React, SwiftUI, Compose and gpui.

exponential-ui-image on Web
exponential-ui-image on iOS
exponential-ui-image on Android
exponential-ui-image on Desktop
Prop Type Required Bindable Description
src url – yes The image URL; omit for a placeholder.
alt string yes yes The accessibility description.
fit contain | cover | fill | none | scaleDown – – How the picture fills its box. Default "cover".
width number – – Fixed width in px; otherwise the box decides.
height number – – Fixed height in px.
aspectRatio number – – Width over height (16:9 when unset and no height); the box never waits for the picture.
fallback icon – – An icon shown when the picture fails or is missing.
loading lazy | eager – – Defer loading until near the viewport, or load at once. Default "lazy".
focalX number – – Horizontal focal point 0..1 kept when cropped (0.5).
focalY number – – Vertical focal point 0..1 kept when cropped (0.5).
style style – – Extra Box styles for the image box.

None.

None.

none

The basic catalog’s Image renders as Image.

A native component: every renderer paints it directly.

Role: img

img (alt = name; decorative when alt is empty)

Not focusable; no keys.

Recipe parts: Image/root Image/fallback

Keyed by: fit :hover :pressed :focus :disabled :checked :open :selected :invalid :dragover

Themes · Write a theme

Mosaic · Chip · ZoomableImage · Icon · Video · AudioPlayer · Avatar · QrCode