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.

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

The type has been superseded by ImageElement.

An element that renders image content.

#altTextAltText
Optional

A description of the image content.

Properties of altText
#decorativeboolean
Optional

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.
#textstring
Required

The text content.

#typestring
Required

The type of element.

This must be "image".

#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>