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

SVG elements should use explicit width and height. 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