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
event
DragStartEvent<E>
RequiredA drag start event.
currentTarget
E
RequireddragData
object
RequiredElement 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.
type
string
RequiredThe type of element.
This must be "audio"
.
resolveAudioRef
function
RequiredA function that returns a reference (ref) to an audio asset in Canva's backend.
Returns
A Promise
that resolves with the following object:
ref
AudioRef
A unique identifier that references an audio asset in Canva's backend.
durationMs
number
RequiredThe duration of the audio track, in milliseconds.
title
string
RequiredA human readable title for the audio track.
Embed element to be added to the design at the end of a drag event.
type
string
RequiredThe type of element.
This must be "embed"
.
previewSize
Dimensions
RequiredThe dimensions of the preview image.
width
number
RequiredA width, in pixels.
height
number
RequiredA height, in pixels.
previewUrl
string
RequiredThe URL of an image to display under the user's cursor during the drag and drop event.
embedUrl
string
RequiredThe 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.
type
string
RequiredThe type of element.
This must be "text"
.
children
string[]
OptionalThe text content to drag.
textAlign
string
OptionalThe alignment of the text.
Default value: "start"
Available values:
"start"
"center"
"end"
"justify"
fontWeight
FontWeight
OptionalThe weight (thickness) of the font.
Default value: "normal"
Available values:
"normal"
"thin"
"extralight"
"light"
"medium"
"semibold"
"bold"
"ultrabold"
"heavy"
fontStyle
string
OptionalThe style of the font.
Default value: "normal"
Available values:
"normal"
"italic"
decoration
string
OptionalThe decoration of the font.
Default value: "none"
Available values:
"none"
"underline"
fontRef
FontRef
OptionalA unique identifier that points to a font asset in Canva's backend.
Video element or content to be added to the design at the end of a drag event.
type
string
RequiredThe type of element.
This must be "video"
.
resolveVideoRef
function
RequiredA 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
RequiredThe dimensions of the preview image.
width
number
RequiredA width, in pixels.
height
number
RequiredA height, in pixels.
previewUrl
string
RequiredThe URL of an image to display under the user's cursor during the drag and drop event.
fullSize
Dimensions
OptionalThe 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.
width
number
RequiredA width, in pixels.
height
number
RequiredA height, in pixels.
Image element or content to be added to the design at the end of a drag event.
type
string
RequiredThe type of element.
This must be "image"
.
previewSize
Dimensions
RequiredThe dimensions of the preview image.
width
number
RequiredA width, in pixels.
height
number
RequiredA height, in pixels.
resolveImageRef
function
RequiredA 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
RequiredThe URL of an image to display under the user's cursor during the drag and drop event.
fullSize
Dimensions
OptionalThe dimensions of the full-size image.
width
number
RequiredA width, in pixels.
height
number
RequiredA height, in pixels.
Returns
Promise<void>