AbsoluteElementState

API reference for the AbsoluteElementState type.

An element state that can exist on an absolute page state.

Type declaration

A state that creates a rectangle element.

The rectangle can be filled with image content, video content, or a solid color.

typestringRead-only
Required

The type of content.

This must be "rect".

fillFillStateRead-only
Required

The appearance of the rectangle's interior.

mediaContainerundefined | MediaFillState
Required

The media fill for the path, if any.

A state that creates an image fill.

typestringRead-only
Required

The type of media.

This must be "image".

imageRefImageRefRead-only
Required

A unique identifier that points to an image asset in Canva's backend.

flipXboolean
Required

If true, the image is flipped horizontally.

flipYboolean
Required

If true, the image is flipped vertically.

A state that creates a video fill.

typestringRead-only
Required

The type of media.

This must be "video".

videoRefVideoRefRead-only
Required

A unique identifier that points to a video asset in Canva's backend.

flipXboolean
Required

If true, the video is flipped horizontally.

flipYboolean
Required

If true, the video is flipped vertically.

colorContainerundefined | ColorFillState
Required

The color fill for the path, if any.

A state that creates a solid color fill.

typestringRead-only
Required

The type of color.

This must be "solid".

colorstring
Required

The color of the fill. This must be a valid, six-digit hex code, prefixed with a # symbol.

  • Must be six characters long.
  • Must start with a #.
  • Must use lowercase letters.

Example

"#ff0099"
TS

Represents something that's not supported by the Apps SDK.

typestringRead-only
Required

This must be "unsupported".

strokeStrokeStateRead-only
Required

The outline of the rectangle.

weightnumber
Required

The weight (thickness) of the stroke.

Minimum: 0

Maximum: 100

colorContainerColorFillState
Required

The color of the stroke.

A state that creates a solid color fill.

typestringRead-only
Required

The type of color.

This must be "solid".

colorstring
Required

The color of the fill. This must be a valid, six-digit hex code, prefixed with a # symbol.

  • Must be six characters long.
  • Must start with a #.
  • Must use lowercase letters.

Example

"#ff0099"
TS

Represents something that's not supported by the Apps SDK.

typestringRead-only
Required

This must be "unsupported".

widthnumberRead-only
Required

A width, in pixels.

heightnumberRead-only
Required

A height, in pixels.

lockedbooleanRead-only
Required

If true, the element is locked and cannot be modified.

topnumberRead-only
Required

The distance from the top edge of the container, in pixels.

  • The pixels are relative to their container.

Minimum: -32768

Maximum: 32767

leftnumberRead-only
Required

The distance from the left edge of the container, in pixels.

  • The pixels are relative to their container.

Minimum: -32768

Maximum: 32767

rotationnumberRead-only
Required

A rotation, in degrees.

Minimum: -180

Maximum: 180

transparencynumberRead-only
Required

Transparency as a percentage.

Minimum: 0

Maximum: 1

A state that creates a vector shape element.

typestringRead-only
Required

The type of content.

This must be "shape".

viewBoxAlignedBoxStateRead-only
Required

The scale and cropping of the shape.

topnumberRead-only
Required

The distance of the shape from the top edge of the element, in pixels.

leftnumberRead-only
Required

The distance of the shape from the left edge of the element, in pixels.

widthnumberRead-only
Required

The width of the view box, in pixels.

heightnumberRead-only
Required

The height of the view box, in pixels.

pathsListState<PathState>Read-only
Required

The paths that define the structure of the shape.

  • Must have between 1 and 30 paths.
  • Total size of all paths must not exceed 2kb.
  • Maximum of 6 unique fill colors across all paths.

For more information, see ListState.

widthnumberRead-only
Required

A width, in pixels.

heightnumberRead-only
Required

A height, in pixels.

lockedbooleanRead-only
Required

If true, the element is locked and cannot be modified.

topnumberRead-only
Required

The distance from the top edge of the container, in pixels.

  • The pixels are relative to their container.

Minimum: -32768

Maximum: 32767

leftnumberRead-only
Required

The distance from the left edge of the container, in pixels.

  • The pixels are relative to their container.

Minimum: -32768

Maximum: 32767

rotationnumberRead-only
Required

A rotation, in degrees.

Minimum: -180

Maximum: 180

transparencynumberRead-only
Required

Transparency as a percentage.

Minimum: 0

Maximum: 1

A state that creates a group element.

typestringRead-only
Required

The type of content.

This must be "group".

contentsListState<GroupContentElementState>Read-only
Required

The elements that exist within the group.

For more information, see ListState.

widthnumberRead-only
Required

A width, in pixels.

heightnumberRead-only
Required

A height, in pixels.

lockedbooleanRead-only
Required

If true, the element is locked and cannot be modified.

topnumberRead-only
Required

The distance from the top edge of the container, in pixels.

  • The pixels are relative to their container.

Minimum: -32768

Maximum: 32767

leftnumberRead-only
Required

The distance from the left edge of the container, in pixels.

  • The pixels are relative to their container.

Minimum: -32768

Maximum: 32767

rotationnumberRead-only
Required

A rotation, in degrees.

Minimum: -180

Maximum: 180

transparencynumberRead-only
Required

Transparency as a percentage.

Minimum: 0

Maximum: 1

A state that creates an embed element, such as a YouTube video.

typestringRead-only
Required

The type of content.

This must be "embed".

urlstringRead-only
Required

The URL of the rich media.

This URL must be supported by the Iframely API.

widthnumberRead-only
Required

A width, in pixels.

heightnumberRead-only
Required

A height, in pixels.

lockedbooleanRead-only
Required

If true, the element is locked and cannot be modified.

topnumberRead-only
Required

The distance from the top edge of the container, in pixels.

  • The pixels are relative to their container.

Minimum: -32768

Maximum: 32767

leftnumberRead-only
Required

The distance from the left edge of the container, in pixels.

  • The pixels are relative to their container.

Minimum: -32768

Maximum: 32767

rotationnumberRead-only
Required

A rotation, in degrees.

Minimum: -180

Maximum: 180

transparencynumberRead-only
Required

Transparency as a percentage.

Minimum: 0

Maximum: 1

A state that creates a text element.

typestringRead-only
Required

The type of content.

This must be "text".

textobjectRead-only
Required

The text content.

regionsListState<TextRegion>
Required

A list of items that can be read.

For more information, see ListState.

widthnumberRead-only
Required

A width, in pixels.

heightnumberRead-only
Required

A height, in pixels.

lockedbooleanRead-only
Required

If true, the element is locked and cannot be modified.

topnumberRead-only
Required

The distance from the top edge of the container, in pixels.

  • The pixels are relative to their container.

Minimum: -32768

Maximum: 32767

leftnumberRead-only
Required

The distance from the left edge of the container, in pixels.

  • The pixels are relative to their container.

Minimum: -32768

Maximum: 32767

rotationnumberRead-only
Required

A rotation, in degrees.

Minimum: -180

Maximum: 180

transparencynumberRead-only
Required

Transparency as a percentage.

Minimum: 0

Maximum: 1

An element state that is not supported by the Apps SDK.

typestringRead-only
Required

This must be "unsupported".

widthnumberRead-only
Required

A width, in pixels.

heightnumberRead-only
Required

A height, in pixels.

lockedbooleanRead-only
Required

If true, the element is locked and cannot be modified.

topnumberRead-only
Required

The distance from the top edge of the container, in pixels.

  • The pixels are relative to their container.

Minimum: -32768

Maximum: 32767

leftnumberRead-only
Required

The distance from the left edge of the container, in pixels.

  • The pixels are relative to their container.

Minimum: -32768

Maximum: 32767

rotationnumberRead-only
Required

A rotation, in degrees.

Minimum: -180

Maximum: 180

transparencynumberRead-only
Required

Transparency as a percentage.

Minimum: 0

Maximum: 1