ui.startDragToPoint
Adds the specified element or content to fixed designs, which use a coordinate-based positioning system at the end of a drag event.
Parameters
eventDragStartEvent<E>A drag start event.
currentTargetEdragDataobjectElement or content to be added to the design at the end of the drag event.
Audio track to be added to the design at the end of a drag event.
typestringThe type of element.
The only valid value is "audio".
resolveAudioReffunctionA function that returns a reference (ref) to an audio asset in Canva's backend.
Returns
A Promise that resolves with the following object:
refAudioRefA unique identifier that references an audio asset in Canva's backend.
durationMsnumberThe duration of the audio track, in milliseconds.
titlestringA human readable title for the audio track.
Embed element to be added to the design at the end of a drag event.
typestringThe type of element.
The only valid value is "embed".
previewSizeDimensionsThe dimensions of the preview image.
widthnumberA width, in pixels.
heightnumberA height, in pixels.
previewUrlstringThe URL of an image to display under the user's cursor during the drag and drop event.
embedUrlstringThe URL of media that can be embedded, such as the URL of a YouTube video.
This URL must be supported by the Iframely API.
Text element or content to be added to the design at the end of a drag event.
typestringThe type of element.
The only valid value is "text".
childrenstring[]The text content to drag.
textAlignstringThe alignment of the text.
Default value: "start"
Available values:
"start""center""end""justify"
fontWeightFontWeightThe weight (thickness) of the font.
Default value: "normal"
Available values:
"normal""thin""extralight""light""medium""semibold""bold""ultrabold""heavy"
fontStylestringThe style of the font.
Default value: "normal"
Available values:
"normal""italic"
decorationstringThe decoration of the font.
Default value: "none"
Available values:
"none""underline"
Video element or content to be added to the design at the end of a drag event.
typestringThe type of element.
The only valid value is "video".
resolveVideoReffunctionA function that returns a reference (ref) to a video asset in Canva's backend.
Returns
A Promise that resolves with the following object:
refVideoRefA unique identifier that references a video asset in Canva's backend.
previewSizeDimensionsThe dimensions of the preview image.
widthnumberA width, in pixels.
heightnumberA height, in pixels.
previewUrlstringThe URL of an image to display under the user's cursor during the drag and drop event.
fullSizeDimensionsThe dimensions of the full-size video.
- These dimensions are used when adding the video to the design
- If omitted, the
previewSizedimensions are used as a fallback.
widthnumberA width, in pixels.
heightnumberA height, in pixels.
Image element or content to be added to the design at the end of a drag event.
typestringThe type of element.
The only valid value is "image".
previewSizeDimensionsThe dimensions of the preview image.
widthnumberA width, in pixels.
heightnumberA height, in pixels.
resolveImageReffunctionA function that returns a reference (ref) to an audio asset in Canva's backend.
Returns
A Promise that resolves with the following object:
refImageRefA unique identifier that references an image asset in Canva's backend.
previewUrlstringThe URL of an image to display under the user's cursor during the drag and drop event.
fullSizeDimensionsThe dimensions of the full-size image.
widthnumberA width, in pixels.
heightnumberA height, in pixels.
Returns
Promise<void>