Creates an app element if one isn't already selected or overwrites an app element's data if one is selected.
To learn more, see Setting app element data.
Usage
import { getDesignInteraction } from "@canva/design-interaction";const designInteraction = getDesignInteraction();designInteraction.setAppElementData({name: "David",age: 32,location: "Australia",});
Parameters
The data to attach to the app element.
The dimensions and position of the app element.
The width of the app element, in pixels.
If height
is a number, this can be set to "auto"
. Otherwise, it must be an integer between 0 and 32767.
The height of the app element, in pixels.
If width
is a number, this can be set to "auto"
. Otherwise, it must be an integer between 0 and 32767.
The distance from the top edge of the user's design, in pixels. This must be an integer between -32768 and 32767.
The distance from the left edge of the user's design, in pixels. This must be an integer between -32768 and 32767.
The rotation of the element, in degrees. This must be an integer between -180 and 180.
Returns
void