Handles both raster and vector assets. The renderer detects format from the file extension at render time — the author only writes src, w, and h.

img

tagimage & vector

Handles both raster and vector assets. The renderer detects format from the file extension at render time — the author only writes src, w, and h.

The name attribute carries the Figma layer name. fit controls image scaling within the bounding box.

AttrTypeDescription
namestring
src requiredasset
xnumber
ynumber
w requirednumber | 'fill'Required on img — no content to derive size from
h requirednumber | 'fill'Required on img — no content to derive size from
fitfill none cover contain
radiusnumber | string
corner-smoothingnumber
borderstring
border-colorcolor | token
border-widthnumber
border-stylesolid dashed dotted
border-aligncenter inside outside
object-positionstring
image-renderingauto pixelated crisp-edges

Inherited properties

AttrType / valuesNotes
opacitynumberLayer opacity, 0–1. Omitted when 1.
blendnormal, multiply, screen, overlay, darken, lighten, color-dodge, color-burn, hard-light, soft-light, difference, exclusion, hue, saturation, color, luminosity, linear-burn, linear-dodgeBlend mode against layers below. Omitted when normal.
maskbooleanPresence = true. Acts as an alpha mask for subsequent siblings.
rotationnumberRotation in degrees. Omitted when 0.
constraint-hleft, right, center, scale, stretchHorizontal pin/resize behavior. Default left (omitted).
constraint-vcenter, scale, stretch, top, bottomVertical pin/resize behavior. Default top (omitted).
absbooleanAbsolute child inside auto-layout. Presence = true. Replaces layout-position="absolute".
min-widthnumberMinimum width in px. Omitted when unset.
max-widthnumberMaximum width in px. Omitted when unset.
min-heightnumberMinimum height in px. Omitted when unset.
max-heightnumberMaximum height in px. Omitted when unset.
fliph, v, bothMirror transform — 'h', 'v', or 'both'.
filterstringCSS filter string, e.g. "brightness(1.2) contrast(0.9)".
isolationbooleanPresence = true. New stacking context for blend modes (isolation: isolate).
transform-originstringTransform origin, e.g. "top-left", "center", "0% 0%".
scale-xnumberCSS scaleX, e.g. 1.5.
scale-ynumberCSS scaleY, e.g. 0.8.
skew-xnumberHorizontal skew in degrees.
skew-ynumberVertical skew in degrees.
aspect-ratiostringAspect ratio, e.g. "16/9", "1/1".
z-indexnumberExplicit CSS z-index.
visiblebooleanfalse = visibility:hidden (preserved in file, skipped in render).

Example

<img name="Hero Image" src="assets/hero.webp" w="390" h="240" fit="cover" />
<img src="assets/avatar.webp" w="48" h="48" radius="24" fit="cover" />
<img src="assets/icon-check.svg" w="20" h="20" />