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.
This version of the API is a preview. Preview APIs are unstable and may change without warning. You can't release public apps using this API until it's stable.

Describes how a fill is filled with color or media.

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

Properties

mediaContainerobjectRead-only
Required

A media fill, if any.

setfunction
Required

Parameters

stateundefined | MediaFillState
Required

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.

Returns

void

refundefined | MediaFill
Required

An image that fills the interior of a media.

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 video that fills the interior of a media.

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.

colorContainerobjectRead-only
Required

A color fill, if any.

setfunction
Required

Parameters

stateundefined | SolidFillState
Required
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

Returns

void

refundefined | ColorFill
Required

A solid color that fills an interior.

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