Components / Media

Image native

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

A2UI basic
Image
Children
none
Loading the renderer…
Image rendered by the React renderer on Web
Web React
Image rendered by the SwiftUI renderer on iOS
iOS SwiftUI
Image rendered by the Compose renderer on Android
Android Compose
Image rendered by the gpui renderer on Desktop
Desktop gpui

View exponential-ui-image, painted by each native renderer.

fit · contain
fit · cover
fit · fill
fit · none
fit · scaleDown
PropTypeDefaultDescription
srcbindurl–The image URL; omit for a placeholder.
altrequiredstring–The accessibility description.
fitcontain | cover | fill | none | scaleDown"cover"How the picture fills its box.
widthnumber–Fixed width in px; otherwise the box decides.
heightnumber–Fixed height in px.
aspectRationumber–Width over height (16:9 when unset and no height); the box never waits for the picture.
fallbackicon–An icon shown when the picture fails or is missing.
loadinglazy | eager"lazy"Defer loading until near the viewport, or load at once.
focalXnumber–Horizontal focal point 0..1 kept when cropped (0.5).
focalYnumber–Vertical focal point 0..1 kept when cropped (0.5).
stylestyle–Extra Box styles for the image box.

No events, no slots. Children: none.

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

Not focusable; no keys.

Recipe parts
Image/rootImage/fallback
Keyed by
fit:hover:pressed:focus:disabled:checked:open:selected:invalid:dragover

Themes · Write a theme