Path
A path that defines the structure of a shape element.
Properties
d
string
Read-onlyRequiredThe 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
andT
commands are not permitted.- The path must be closed using a
Z
command or matching start and end coordinates.
fill
PathFill
Read-onlyRequiredThe appearance of the path's interior.
isMediaEditable
boolean
Read-onlyRequiredThis must be true
.
mediaContainer
object
Read-onlyRequiredA media fill, if any.
set
function
RequiredParameters
state
undefined | MediaFillState
RequiredA state that creates an image fill.
type
string
Read-onlyRequiredThe type of media.
This must be "image"
.
imageRef
ImageRef
Read-onlyRequiredA unique identifier that points to an image asset in Canva's backend.
flipX
boolean
RequiredIf true
, the image is flipped horizontally.
flipY
boolean
RequiredIf true
, the image is flipped vertically.
A state that creates a video fill.
type
string
Read-onlyRequiredThe type of media.
This must be "video"
.
videoRef
VideoRef
Read-onlyRequiredA unique identifier that points to a video asset in Canva's backend.
flipX
boolean
RequiredIf true
, the video is flipped horizontally.
flipY
boolean
RequiredIf true
, the video is flipped vertically.
Returns
void
ref
undefined | MediaFill
RequiredAn image that fills the interior of a media.
type
string
Read-onlyRequiredThe type of media.
This must be "image"
.
imageRef
ImageRef
Read-onlyRequiredA unique identifier that points to an image asset in Canva's backend.
flipX
boolean
RequiredIf true
, the image is flipped horizontally.
flipY
boolean
RequiredIf true
, the image is flipped vertically.
A video that fills the interior of a media.
type
string
Read-onlyRequiredThe type of media.
This must be "video"
.
videoRef
VideoRef
Read-onlyRequiredA unique identifier that points to a video asset in Canva's backend.
flipX
boolean
RequiredIf true
, the video is flipped horizontally.
flipY
boolean
RequiredIf true
, the video is flipped vertically.
colorContainer
object
Read-onlyRequiredA color fill, if any.
set
function
RequiredParameters
state
undefined | SolidFillState
Requiredtype
string
Read-onlyRequiredThe type of color.
This must be "solid"
.
color
string
RequiredThe 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
ref
undefined | ColorFill
RequiredA solid color that fills an interior.
type
string
Read-onlyRequiredThe type of color.
This must be "solid"
.
color
string
RequiredThe 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.
type
string
Read-onlyRequiredThis must be "unsupported"
.
isMediaEditable
boolean
Read-onlyRequiredThis must be false
.
mediaContainer
object
Read-onlyRequiredA media fill, if any. MediaFill is not editable
ref
undefined | MediaFill
RequiredAn image that fills the interior of a media.
type
string
Read-onlyRequiredThe type of media.
This must be "image"
.
imageRef
ImageRef
Read-onlyRequiredA unique identifier that points to an image asset in Canva's backend.
flipX
boolean
RequiredIf true
, the image is flipped horizontally.
flipY
boolean
RequiredIf true
, the image is flipped vertically.
A video that fills the interior of a media.
type
string
Read-onlyRequiredThe type of media.
This must be "video"
.
videoRef
VideoRef
Read-onlyRequiredA unique identifier that points to a video asset in Canva's backend.
flipX
boolean
RequiredIf true
, the video is flipped horizontally.
flipY
boolean
RequiredIf true
, the video is flipped vertically.
colorContainer
object
Read-onlyRequiredA color fill, if any.
set
function
RequiredParameters
state
undefined | SolidFillState
Requiredtype
string
Read-onlyRequiredThe type of color.
This must be "solid"
.
color
string
RequiredThe 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
ref
undefined | ColorFill
RequiredA solid color that fills an interior.
type
string
Read-onlyRequiredThe type of color.
This must be "solid"
.
color
string
RequiredThe 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.
type
string
Read-onlyRequiredThis must be "unsupported"
.
stroke
Stroke | undefined
Read-onlyRequiredThe stroke (outline) of the path, if any.
For more information, see Stroke.