Adds the specified element or content to responsive documents, which slot things into a text stream at the end of a drag event.
Parameters
event
DragStartEvent<E>
A drag start event.
Properties of event
currentTarget
E
dragData
object
Element or content to be added to the design at the end of the drag event.
Embed element to be added to the design at the end of a drag event.
type
string
The type of element.
This must be "embed"
.
previewSize
Dimensions
The dimensions of the preview image.
Properties of previewSize
width
number
A width, in pixels.
height
number
A height, in pixels.
previewUrl
string
The URL of an image to display under the user's cursor during the drag and drop event.
embedUrl
string
The URL of media that can be embedded, such as the URL of a YouTube video.
This URL must be supported by the Iframely API.
Video element or content to be added to the design at the end of a drag event.
type
string
The type of element.
This must be "video"
.
resolveVideoRef
function
A function that returns a reference (ref) to a video asset in Canva's backend.
Returns
A Promise
that resolves with the following object:
ref
VideoRef
A unique identifier that references a video asset in Canva's backend.
previewSize
Dimensions
The dimensions of the preview image.
Properties of previewSize
width
number
A width, in pixels.
height
number
A height, in pixels.
previewUrl
string
The URL of an image to display under the user's cursor during the drag and drop event.
fullSize
Dimensions
The dimensions of the full-size video.
- These dimensions are used when adding the video to the design
- If omitted, the
previewSize
dimensions are used as a fallback.
Properties of fullSize
width
number
A width, in pixels.
height
number
A height, in pixels.
Image element or content to be added to the design at the end of a drag event.
type
string
The type of element.
This must be "image"
.
previewSize
Dimensions
The dimensions of the preview image.
Properties of previewSize
width
number
A width, in pixels.
height
number
A height, in pixels.
resolveImageRef
function
A function that returns a reference (ref) to an audio asset in Canva's backend.
Returns
A Promise
that resolves with the following object:
ref
ImageRef
A unique identifier that references an image asset in Canva's backend.
previewUrl
string
The URL of an image to display under the user's cursor during the drag and drop event.
fullSize
Dimensions
The dimensions of the full-size image.
Properties of fullSize
width
number
A width, in pixels.
height
number
A height, in pixels.
Returns
Promise<void>