API reference
Design
addAudioTrackaddElementAtCursoraddElementAtPointaddNativeElementaddPagecreateRichtextRangeeditContentgetCurrentPageContextgetDefaultPageDimensionsgetDesignTokeninitAppElementoverlay.registerOnCanOpenopenDesignrequestExportselection.registerOnChangesetCurrentPageBackgroundui.startDragToCursorui.startDragToPointui.startDrag
Platform
appProcessappProcess.broadcastMessageappProcess.currentappProcess.current.getInfoappProcess.current.requestCloseappProcess.current.setOnDisposeappProcess.requestCloseappProcess.registerOnMessageappProcess.registerOnStateChangefeatures.isSupportedfeatures.registerOnSupportChangegetPlatformInforequestOpenExternalUrl
setCurrentPageBackground
API reference for the setCurrentPageBackground method.
This version of the API is in beta. Beta APIs are unstable and may change without warning. You can't release public apps using this API until it's stable.
Updates the background of the user's current page. The background can be a solid color, an image or a video.
Parameters
opts
PageBackgroundFill
REQUIRED
The appearance of a page's background.
Properties of opts
asset
object
OPTIONAL
An image or video to use as the fill.
An image asset that fills a path's interior.
type
string
REQUIRED
The type of fill.
This must be "image"
.
ref
ImageRef
REQUIRED
A unique identifier that points to an image asset in Canva's backend.
A video asset that fills a path's interior.
type
string
REQUIRED
The type of fill.
This must be "video"
.
ref
VideoRef
REQUIRED
A unique identifier that points to a video asset in Canva's backend.
color
string
OPTIONAL
The color of the fill as a hex code.
The hex code must include all six characters and be prefixed with a #
symbol.
Example
" #ff0099"
TS
Returns
Promise<void>