Path
A path that defines the structure of a shape element.
Properties
dstringRead-onlyThe shape of the path.
This is similar to the d attribute of an SVG's path element, with some limitations:
- Must start with an
Mcommand. - Only one
Mcommand is allowed. QandTcommands are not permitted.- The path must be closed using a
Zcommand or matching start and end coordinates.
fillPathFillRead-onlyThe appearance of the path's interior.
isMediaEditablebooleanRead-onlyThe only valid value is true.
mediaContainerobjectRead-onlyA media fill, if any.
setfunctionParameters
stateMediaFillState | undefinedA state that creates an image fill.
typestringRead-onlyThe type of media.
The only valid value is "image".
imageRefImageRefRead-onlyA unique identifier that points to an image asset in Canva's backend.
flipXbooleanIf true, the image is flipped horizontally.
flipYbooleanIf true, the image is flipped vertically.
A state that creates a video fill.
typestringRead-onlyThe type of media.
The only valid value is "video".
videoRefVideoRefRead-onlyA unique identifier that points to a video asset in Canva's backend.
flipXbooleanIf true, the video is flipped horizontally.
flipYbooleanIf true, the video is flipped vertically.
Returns
void
refMediaFill | undefinedAn image that fills the interior of a media.
typestringRead-onlyThe type of media.
The only valid value is "image".
imageRefImageRefRead-onlyA unique identifier that points to an image asset in Canva's backend.
flipXbooleanIf true, the image is flipped horizontally.
flipYbooleanIf true, the image is flipped vertically.
A video that fills the interior of a media.
typestringRead-onlyThe type of media.
The only valid value is "video".
videoRefVideoRefRead-onlyA unique identifier that points to a video asset in Canva's backend.
flipXbooleanIf true, the video is flipped horizontally.
flipYbooleanIf true, the video is flipped vertically.
colorContainerobjectRead-onlyA color fill, if any.
setfunctionParameters
stateSolidFillState | undefinedtypestringRead-onlyThe type of color.
The only valid value is "solid".
colorstringThe 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"
Returns
void
refColorFill | undefinedA solid color that fills an interior.
typestringRead-onlyThe type of color.
The only valid value is "solid".
colorstringThe 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"
Represents something that's not supported by the Apps SDK.
typestringRead-onlyThe only valid value is "unsupported".
isMediaEditablebooleanRead-onlyThe only valid value is false.
mediaContainerobjectRead-onlyA media fill, if any. MediaFill is not editable
refMediaFill | undefinedAn image that fills the interior of a media.
typestringRead-onlyThe type of media.
The only valid value is "image".
imageRefImageRefRead-onlyA unique identifier that points to an image asset in Canva's backend.
flipXbooleanIf true, the image is flipped horizontally.
flipYbooleanIf true, the image is flipped vertically.
A video that fills the interior of a media.
typestringRead-onlyThe type of media.
The only valid value is "video".
videoRefVideoRefRead-onlyA unique identifier that points to a video asset in Canva's backend.
flipXbooleanIf true, the video is flipped horizontally.
flipYbooleanIf true, the video is flipped vertically.
colorContainerobjectRead-onlyA color fill, if any.
setfunctionParameters
stateSolidFillState | undefinedtypestringRead-onlyThe type of color.
The only valid value is "solid".
colorstringThe 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"
Returns
void
refColorFill | undefinedA solid color that fills an interior.
typestringRead-onlyThe type of color.
The only valid value is "solid".
colorstringThe 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"
Represents something that's not supported by the Apps SDK.
typestringRead-onlyThe only valid value is "unsupported".
strokeStroke | undefinedRead-onlyThe stroke (outline) of the path, if any.
For more information, see Stroke.