On September 25th, 2024, we released v2 of the Apps SDK. To learn what’s new and how to upgrade, see Migration FAQ and Migration guide.

Path

API reference for the Path type.

A path that defines the structure of a shape element.

Properties

dstringRead-onlyRequired

The shape of the path.

This is similar to the d attribute of an SVG's path element, with some limitations:

  • Must start with an M command.
  • Only one M command is allowed.
  • Q and T commands are not permitted.
  • The path must be closed using a Z command or matching start and end coordinates.
fillPathFillRead-onlyRequired

The appearance of the path's interior.

isMediaEditablebooleanRead-onlyRequired

This must be true.

mediaContainerobjectRead-onlyRequired

A media fill, if any.

setfunctionRequired

Parameters

stateundefined | MediaFillStateRequired

A state that creates an image fill.

typestringRead-onlyRequired

The type of media.

This must be "image".

imageRefImageRefRead-onlyRequired

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

flipXbooleanRequired

If true, the image is flipped horizontally.

flipYbooleanRequired

If true, the image is flipped vertically.

A state that creates a video fill.

typestringRead-onlyRequired

The type of media.

This must be "video".

videoRefVideoRefRead-onlyRequired

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

flipXbooleanRequired

If true, the video is flipped horizontally.

flipYbooleanRequired

If true, the video is flipped vertically.

Returns

void

refundefined | MediaFillRequired

An image that fills the interior of a media.

typestringRead-onlyRequired

The type of media.

This must be "image".

imageRefImageRefRead-onlyRequired

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

flipXbooleanRequired

If true, the image is flipped horizontally.

flipYbooleanRequired

If true, the image is flipped vertically.

A video that fills the interior of a media.

typestringRead-onlyRequired

The type of media.

This must be "video".

videoRefVideoRefRead-onlyRequired

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

flipXbooleanRequired

If true, the video is flipped horizontally.

flipYbooleanRequired

If true, the video is flipped vertically.

colorContainerobjectRead-onlyRequired

A color fill, if any.

setfunctionRequired

Parameters

stateundefined | SolidFillStateRequired
typestringRead-onlyRequired

The type of color.

This must be "solid".

colorstringRequired

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

Returns

void

refundefined | ColorFillRequired

A solid color that fills an interior.

typestringRead-onlyRequired

The type of color.

This must be "solid".

colorstringRequired

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-onlyRequired

This must be "unsupported".

isMediaEditablebooleanRead-onlyRequired

This must be false.

mediaContainerobjectRead-onlyRequired

A media fill, if any. MediaFill is not editable

refundefined | MediaFillRequired

An image that fills the interior of a media.

typestringRead-onlyRequired

The type of media.

This must be "image".

imageRefImageRefRead-onlyRequired

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

flipXbooleanRequired

If true, the image is flipped horizontally.

flipYbooleanRequired

If true, the image is flipped vertically.

A video that fills the interior of a media.

typestringRead-onlyRequired

The type of media.

This must be "video".

videoRefVideoRefRead-onlyRequired

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

flipXbooleanRequired

If true, the video is flipped horizontally.

flipYbooleanRequired

If true, the video is flipped vertically.

colorContainerobjectRead-onlyRequired

A color fill, if any.

setfunctionRequired

Parameters

stateundefined | SolidFillStateRequired
typestringRead-onlyRequired

The type of color.

This must be "solid".

colorstringRequired

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

Returns

void

refundefined | ColorFillRequired

A solid color that fills an interior.

typestringRead-onlyRequired

The type of color.

This must be "solid".

colorstringRequired

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-onlyRequired

This must be "unsupported".

strokeStroke | undefinedRead-onlyRequired

The stroke (outline) of the path, if any.

For more information, see Stroke.