CanvaElement

Represents an element as it appears in the user's design. For example, when a user selects an image and opens an editing extension, the selected image and its metadata (for example, position and rotation) is the element.

Signature

type CanvaElement<
T extends CanvaMedia | CanvaImageUrl | CanvaImageBlob | undefined
> = {
type: CanvaDataType.CANVA_ELEMENT;
data: T;
layout: CanvaElementLayout;
fixed: boolean;
};

Properties

Name

Type

Required

Description

type

CanvaDataType.CANVA_ELEMENT

Yes

This value is always "canva_element".

data

CanvaMedia | CanvaImageBlob | CanvaImageUrl | undefined

Yes

The user's image.

layout

CanvaElementLayout

Yes

The layout of the element.

fixed

boolean

Yes

If true, the user's image is inside a page background, grid, or frame. This prevents the extension from changing the element's layout. The extension can only reposition the user's image within the element.