addNativeElement

API reference for the addNativeElement method.

Adds a native element to the user's design.

#elementobject
Required

The element to add to the user's design.

The type has been superseded by DesignElement.

An element that's natively supported by the Canva editor.

The type has been superseded by ImageElement.

An element that renders image content.

#typestring
Required

The type of element.

This must be "image".

#altTextAltText | undefined
Required

A description of the image content.

Properties of altText
#textstring
Required

The text content.

#decorativeboolean | undefined
Required

Indicates where the alternative text should be displayed.

  • If true, the alternative text will only be displayed in the editor.
  • If false, the alternative text will be displayed in the editor and in view-only mode.
#dataUrlstring
Optional

A data URL that contains the image data.

#refImageRef
Optional

A unique identifier that points to an image asset in Canva's backend.

Promise<void>