Skip to main content

Resize

resize scales media to the project canvas while preserving the asset aspect ratio.

type ResizeMode = "contain" | "cover";
ValueBehavior
containFits the full asset inside the canvas.
coverFills the canvas and may crop the asset.

resize is supported for IMAGE, VIDEO, and GIF elements.

note

HTML/TEXT elements (and the deprecated SVG element) use explicit width and height instead of resize. Although resize may pass API validation for SVG, it is not applied during rendering.

Example

{
"type": "IMAGE",
"src": "https://cdn.example.com/photo.jpg",
"resize": "cover",
"position": "center-center"
}

Used By

resize: cover fills the box, cropping overflow