setCurrentPageBackground
Updates the background of the user's current page. The background can be a solid color, an image or a video.
Parameters
opts
PageBackgroundFill
RequiredThe appearance of a page's background.
asset
object
OptionalAn image or video to use as the fill.
An image asset that fills a path's interior.
type
string
RequiredThe type of fill.
This must be "image"
.
ref
ImageRef
RequiredA unique identifier that points to an image asset in Canva's backend.
altText
AltText
OptionalA description of the image content.
Use undefined
for content with no description.
text
string
RequiredThe text content.
decorative
boolean | undefined
RequiredIndicates where the alternative text should be displayed.
- If
true
, the alternative text will only be displayed in the editor. - If
false
, the alternative text will be displayed in the editor and in view-only mode.
A video asset that fills a path's interior.
type
string
RequiredThe type of fill.
This must be "video"
.
ref
VideoRef
RequiredA unique identifier that points to a video asset in Canva's backend.
altText
AltText
OptionalA description of the image content.
Use undefined
for content with no description.
text
string
RequiredThe text content.
decorative
boolean | undefined
RequiredIndicates where the alternative text should be displayed.
- If
true
, the alternative text will only be displayed in the editor. - If
false
, the alternative text will be displayed in the editor and in view-only mode.
color
string
OptionalThe color of the fill as a hex code.
The hex code must include all six characters and be prefixed with a #
symbol.
Example
"#ff0099"
Returns
Promise<void>