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.

Fill

API reference for the Fill type.

Describes how a fill is filled with color or media.

If both media and color are defined, media takes precedence.

Properties

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".