When adding an audio track to a design, set the following properties:
The options for configuring the drag and drop behavior of a DOM node.
The DOM node to make draggable.
A callback function that runs at the start of a drag event.
A callback function that runs at the end of a drag event. This function always runs, regardless of whether or not the user successfully drops something into their design.
The options for configuring what's added to the user's design at the end of a drag event.
The type of element to add to the design. For audio tracks, this must be "AUDIO"
.
A human-readable title that appears in the Canva editor.
The duration of the audio file, in milliseconds.
A function that returns the result of the upload
method.
When adding an image to a design, set the following properties:
The options for configuring the drag and drop behavior of a DOM node.
The DOM node to make draggable.
A callback function that runs at the start of a drag event.
A callback function that runs at the end of a drag event. This function always runs, regardless of whether or not the user successfully drops something into their design.
The options for configuring what's added to the user's design at the end of a drag event.
The type of element to add to the design. For images, this must be "IMAGE"
.
A function that returns the result of the upload
method.
The dimensions of the drag preview, in pixels. The dimensions should have the same aspect ratio as the full-size image.
The width of the drag preview, in pixels.
The height of the drag preview, in pixels.
The dimensions of the full-size image. If omitted, the drag preview dimensions are used.
The width of the full-size image, in pixels.
The height of the full-size image, in pixels.
The URL or data URL of the image to use for the drag preview. This image will appear under the user's cursor during the drag event. If omitted, the full-size image will be used.
When adding text to a design, set the following properties:
The options for configuring the drag and drop behavior of a DOM node.
The DOM node to make draggable.
A callback function that runs at the start of a drag event.
A callback function that runs at the end of a drag event. This function always runs, regardless of whether or not the user successfully drops something into their design.
The options for configuring what's added to the user's design at the end of a drag event.
The type of element to add to the design. For text, this must be "TEXT"
.
The text to add to the user's design, provided as an array of strings.
The horizontal alignment of the text.
The available options include:
The default value is "start"
.
The weight (boldness) of the font.
The available options include:
The default value is "normal"
.
The style of the font.
The available options include:
The default value is "normal"
.
The decoration to apply to the font.
The available options include:
The default value is "normal"
.
When adding a video to a design, set the following properties:
The options for configuring the drag and drop behavior of a DOM node.
The DOM node to make draggable.
A callback function that runs at the start of a drag event.
A callback function that runs at the end of a drag event. This function always runs, regardless of whether or not the user successfully drops something into their design.
The options for configuring what's added to the user's design at the end of a drag event.
The type of element to add to the design. For videos, this must be "VIDEO"
.
A function that returns the result of the upload
method.
The dimensions of the drag preview, in pixels. The dimensions should have the same aspect ratio as the full-size video.
The width of the drag preview, in pixels.
The height of the drag preview, in pixels.
The URL or data URL of the image to use for the drag preview. This image will appear under the user's cursor during the drag event. If omitted, the full-size image will be used.
The dimensions of the full-size video, in pixels. If omitted, the drag preview dimensions are used.
The width of the full-size video, in pixels.
The height of the full-size video, in pixels.