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 (e.g. position and rotation) is the element.

Signature

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

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.