> ## Documentation Index
> Fetch the complete documentation index at: https://www.canva.dev/docs/apps/llms.txt
> Use this file to discover all available pages before exploring further.
# addNativeElement
API reference for the addNativeElement method.
WARNING: This API is deprecated, and is no longer recommended for use, and should be removed from your app.
Adds a native element to the user's design.
## Usage: Basic usage
```typescript
import { addNativeElement } from "@canva/design";
import type { NativeElementWithBox } from "@canva/design";
const element: NativeElementWithBox = {
type: 'text',
children: ['Legacy element'],
top: 100,
left: 100,
width: 200
};
await addNativeElement(element);
```
## Parameters
The element to add to the user's design.
}>
The type has been superseded by `DesignElement`.
An element that's natively supported by the Canva editor.
}>
The type has been superseded by `ImageElement`.
An element that renders image content.
The type of element.
The only valid value is `"image"`.
A description of the image content.
Use `undefined` for content with no description.
Properties of altText>}>
The text content.
Indicates where the alternative text should be displayed.
* If `true`, the alternative text will only be displayed in the editor.
* If `false`, the alternative text will be displayed in the editor and in view-only mode.
A data URL that contains the image data.
A unique identifier that points to an image asset in Canva's backend.
}>
The type has been superseded by `VideoElement`.
An element that renders video content.
The type of element.
The only valid value is `"video"`.
A unique identifier that points to a video asset in Canva's backend.
A description of the video content.
Use `undefined` for content with no description.
Properties of altText>}>
The text content.
Indicates where the alternative text should be displayed.
* If `true`, the alternative text will only be displayed in the editor.
* If `false`, the alternative text will be displayed in the editor and in view-only mode.
}>
The type has been superseded by `EmbedElement`.
An element that renders rich media, such as a YouTube video.
The type of element.
The only valid value is `"embed"`.
The URL of the rich media.
This URL must be supported by the Iframely API.
}>
The type has been superseded by `TextElement`.
An element that renders text content.
The type of element.
The only valid value is `"text"`.
The text content.
Only the first element in this array is used.
The size of the text.
**Minimum**: `1`
**Maximum**: `1000`
**Default value**: `16`
The alignment of the text.
**Default value**: `"start"`
**Available values**:
* `"start"`
* `"center"`
* `"end"`
* `"justify"`
The color of the text as a hex code.
The hex code must include all six characters and be prefixed with a `#` symbol.
**Example**
```ts
"#ff0099"
```
A unique identifier that points to a font asset in Canva's backend.
The weight (thickness) of the font.
**Default value**: `"normal"`
**Available values**:
* `"normal"`
* `"thin"`
* `"extralight"`
* `"light"`
* `"medium"`
* `"semibold"`
* `"bold"`
* `"ultrabold"`
* `"heavy"`
The style of the font.
**Default value**: `"normal"`
**Available values**:
* `"normal"`
* `"italic"`
The decoration of the font.
**Default value**: `"none"`
**Available values**:
* `"none"`
* `"underline"`
}>
The type has been superseded by `ShapeElement`.
An element that renders a vector shape.
The type of element.
The only valid value is `"shape"`.
Options for configuring the scale and cropping of the shape.
Properties of viewBox>}>
The distance of the shape from the top edge of the element, in pixels.
The distance of the shape from the left edge of the element, in pixels.
The width of the view box, in pixels.
The height of the view box, in pixels.
The paths that define the structure of the shape.
* There must be between 1 and 30 paths (inclusive).
* The maximum combined size of all paths must not exceed 2kb.
* The maximum number of unique fill colors across all paths is 6.
Properties of paths>}>
The shape of the path.
This is similar to the `d` attribute of an SVG's `path` element, with some limitations:
* The path must start with an M command.
* The path must not have more than one M command.
* The path must not use the Q command.
* The path must be closed, either by:
* Using a Z command at the end of the path
* Having the last coordinate match the first coordinate
The appearance of the path's interior.
Properties of fill>}>
If `true`, users can replace a fill by dropping an image or video onto it.
The color of the fill as a hex code.
The hex code must include all six characters and be prefixed with a `#` symbol.
**Example**
```ts
"#ff0099"
```
An image or video to use as the fill.
An image asset that fills a path's interior.
The type of fill.
The only valid value is `"image"`.
A unique identifier that points to an image asset in Canva's backend.
A description of the image content.
Use `undefined` for content with no description.
Properties of altText>}>
The text content.
Indicates where the alternative text should be displayed.
* If `true`, the alternative text will only be displayed in the editor.
* If `false`, the alternative text will be displayed in the editor and in view-only mode.
A video asset that fills a path's interior.
The type of fill.
The only valid value is `"video"`.
A unique identifier that points to a video asset in Canva's backend.
A description of the image content.
Use `undefined` for content with no description.
Properties of altText>}>
The text content.
Indicates where the alternative text should be displayed.
* If `true`, the alternative text will only be displayed in the editor.
* If `false`, the alternative text will be displayed in the editor and in view-only mode.
The outline of the path.
Properties of stroke>}>
The weight (thickness) of the stroke.
**Minimum**: `0`
**Maximum**: `100`
The color of the stroke as a hex code.
The hex code must include all six characters and be prefixed with a `#` symbol.
**Example**
```ts
"#ff0099"
```
The alignment of the stroke.
The only valid value is `"inset"`.
}>
The type has been superseded by `GroupElement`.
An element that contains two or more elements.
The type of element.
The only valid value is `"group"`.
The elements to render within the group.
* Each element within a group must have dimensions and a position.
* The dimensions and positions are relative to the dimensions and positions of the group.
}>
The type has been superseded by `ElementAtPoint`.
An element that's natively supported by the Canva editor and has positional properties.
}>
The type has been superseded by `ImageElementAtPoint`.
An element that renders image content and has positional properties.
The type of element.
The only valid value is `"image"`.
A description of the image content.
Use `undefined` for content with no description.
Properties of altText>}>
The text content.
Indicates where the alternative text should be displayed.
* If `true`, the alternative text will only be displayed in the editor.
* If `false`, the alternative text will be displayed in the editor and in view-only mode.
The distance from the top edge of the container, in pixels.
* The pixels are relative to their container.
**Minimum**: `-32768`
**Maximum**: `32767`
The distance from the left edge of the container, in pixels.
* The pixels are relative to their container.
**Minimum**: `-32768`
**Maximum**: `32767`
A width, in pixels.
* The pixels are relative to their container.
**Minimum**: `0`
**Maximum**: `32767`
A height, in pixels.
* The pixels are relative to their container.
**Minimum**: `0`
**Maximum**: `32767`
A rotation, in degrees.
**Minimum**: `-180`
**Maximum**: `180`
A data URL that contains the image data.
A unique identifier that points to an image asset in Canva's backend.
}>
The type has been superseded by `VideoElementAtPoint`.
An element that renders video content and has positional properties.
The type of element.
The only valid value is `"video"`.
A unique identifier that points to a video asset in Canva's backend.
A description of the video content.
Use `undefined` for content with no description.
Properties of altText>}>
The text content.
Indicates where the alternative text should be displayed.
* If `true`, the alternative text will only be displayed in the editor.
* If `false`, the alternative text will be displayed in the editor and in view-only mode.
The distance from the top edge of the container, in pixels.
* The pixels are relative to their container.
**Minimum**: `-32768`
**Maximum**: `32767`
The distance from the left edge of the container, in pixels.
* The pixels are relative to their container.
**Minimum**: `-32768`
**Maximum**: `32767`
A width, in pixels.
* The pixels are relative to their container.
**Minimum**: `0`
**Maximum**: `32767`
A height, in pixels.
* The pixels are relative to their container.
**Minimum**: `0`
**Maximum**: `32767`
A rotation, in degrees.
**Minimum**: `-180`
**Maximum**: `180`
}>
The type has been superseded by `EmbedElementAtPoint`.
An element that renders rich media, such as a YouTube video, and has positional properties.
The type of element.
The only valid value is `"embed"`.
The URL of the rich media.
This URL must be supported by the Iframely API.
The distance from the top edge of the container, in pixels.
* The pixels are relative to their container.
**Minimum**: `-32768`
**Maximum**: `32767`
The distance from the left edge of the container, in pixels.
* The pixels are relative to their container.
**Minimum**: `-32768`
**Maximum**: `32767`
A width, in pixels.
* The pixels are relative to their container.
**Minimum**: `0`
**Maximum**: `32767`
A height, in pixels.
* The pixels are relative to their container.
**Minimum**: `0`
**Maximum**: `32767`
A rotation, in degrees.
**Minimum**: `-180`
**Maximum**: `180`
}>
The type has been superseded by `TextElementAtPoint`.
An element that renders text content and has positional properties.
The type of element.
The only valid value is `"text"`.
The text content.
Only the first element in this array is used.
The distance from the top edge of the container, in pixels.
* The pixels are relative to their container.
**Minimum**: `-32768`
**Maximum**: `32767`
The distance from the left edge of the container, in pixels.
* The pixels are relative to their container.
**Minimum**: `-32768`
**Maximum**: `32767`
The size of the text.
**Minimum**: `1`
**Maximum**: `1000`
**Default value**: `16`
The alignment of the text.
**Default value**: `"start"`
**Available values**:
* `"start"`
* `"center"`
* `"end"`
* `"justify"`
The color of the text as a hex code.
The hex code must include all six characters and be prefixed with a `#` symbol.
**Example**
```ts
"#ff0099"
```
A unique identifier that points to a font asset in Canva's backend.
The weight (thickness) of the font.
**Default value**: `"normal"`
**Available values**:
* `"normal"`
* `"thin"`
* `"extralight"`
* `"light"`
* `"medium"`
* `"semibold"`
* `"bold"`
* `"ultrabold"`
* `"heavy"`
The style of the font.
**Default value**: `"normal"`
**Available values**:
* `"normal"`
* `"italic"`
The decoration of the font.
**Default value**: `"none"`
**Available values**:
* `"none"`
* `"underline"`
A rotation, in degrees.
**Minimum**: `-180`
**Maximum**: `180`
The width of the element, in pixels.
**Minimum**: `0`
**Maximum**: `32767`
}>
The type has been superseded by `ShapeElementAtPoint`.
An element that renders a vector shape and has positional properties.
The type of element.
The only valid value is `"shape"`.
Options for configuring the scale and cropping of the shape.
Properties of viewBox>}>
The distance of the shape from the top edge of the element, in pixels.
The distance of the shape from the left edge of the element, in pixels.
The width of the view box, in pixels.
The height of the view box, in pixels.
The paths that define the structure of the shape.
* There must be between 1 and 30 paths (inclusive).
* The maximum combined size of all paths must not exceed 2kb.
* The maximum number of unique fill colors across all paths is 6.
Properties of paths>}>
The shape of the path.
This is similar to the `d` attribute of an SVG's `path` element, with some limitations:
* The path must start with an M command.
* The path must not have more than one M command.
* The path must not use the Q command.
* The path must be closed, either by:
* Using a Z command at the end of the path
* Having the last coordinate match the first coordinate
The appearance of the path's interior.
Properties of fill>}>
If `true`, users can replace a fill by dropping an image or video onto it.
The color of the fill as a hex code.
The hex code must include all six characters and be prefixed with a `#` symbol.
**Example**
```ts
"#ff0099"
```
An image or video to use as the fill.
An image asset that fills a path's interior.
The type of fill.
The only valid value is `"image"`.
A unique identifier that points to an image asset in Canva's backend.
A description of the image content.
Use `undefined` for content with no description.
Properties of altText>}>
The text content.
Indicates where the alternative text should be displayed.
* If `true`, the alternative text will only be displayed in the editor.
* If `false`, the alternative text will be displayed in the editor and in view-only mode.
A video asset that fills a path's interior.
The type of fill.
The only valid value is `"video"`.
A unique identifier that points to a video asset in Canva's backend.
A description of the image content.
Use `undefined` for content with no description.
Properties of altText>}>
The text content.
Indicates where the alternative text should be displayed.
* If `true`, the alternative text will only be displayed in the editor.
* If `false`, the alternative text will be displayed in the editor and in view-only mode.
The outline of the path.
Properties of stroke>}>
The weight (thickness) of the stroke.
**Minimum**: `0`
**Maximum**: `100`
The color of the stroke as a hex code.
The hex code must include all six characters and be prefixed with a `#` symbol.
**Example**
```ts
"#ff0099"
```
The alignment of the stroke.
The only valid value is `"inset"`.
The distance from the top edge of the container, in pixels.
* The pixels are relative to their container.
**Minimum**: `-32768`
**Maximum**: `32767`
The distance from the left edge of the container, in pixels.
* The pixels are relative to their container.
**Minimum**: `-32768`
**Maximum**: `32767`
A width, in pixels.
* The pixels are relative to their container.
**Minimum**: `0`
**Maximum**: `32767`
A height, in pixels.
* The pixels are relative to their container.
**Minimum**: `0`
**Maximum**: `32767`
A rotation, in degrees.
**Minimum**: `-180`
**Maximum**: `180`
}>
The type has been superseded by `GroupElementAtPoint`.
An element that contains two or more elements and has positional properties.
The type of element.
The only valid value is `"group"`.
The elements to render within the group.
* Each element within a group must have dimensions and a position.
* The dimensions and positions are relative to the dimensions and positions of the group.
The distance from the top edge of the container, in pixels.
* The pixels are relative to their container.
**Minimum**: `-32768`
**Maximum**: `32767`
The distance from the left edge of the container, in pixels.
* The pixels are relative to their container.
**Minimum**: `-32768`
**Maximum**: `32767`
A width, in pixels.
* The pixels are relative to their container.
**Minimum**: `0`
**Maximum**: `32767`
A height, in pixels.
* The pixels are relative to their container.
**Minimum**: `0`
**Maximum**: `32767`
A rotation, in degrees.
**Minimum**: `-180`
**Maximum**: `180`
## Returns
`Promise`
## Permissions
To use this method, the `canva:design:content:write` permission must be enabled for the app. To learn more, see [Permissions](https://www.canva.dev/docs/apps/configuring-intents-permissions/).
## Rate limit
This method has a rate limit of 30 requests every 10 seconds. This limit is shared with the `addElementAtPoint` and `addElementAtCursor` methods.