addElementAtCursor

API reference for the addElementAtCursor method.

Add element to responsive documents, which slot things into a text stream

#elementElementAtCursor
Required

Elements targeting a cursor are a subset of the base Element

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>