toggleSpinner
API reference for the "toggleSpinner" method.
Shows or hides a loading spinner.

Usage

1
const canva = window.canva.init();
2
3
canva.onReady(async (opts) => {
4
// Show the spinner
5
canva.toggleSpinner("preview", true);
6
7
// Hide the spinner
8
// canva.toggleSpinner('preview', false);
9
});
Copied!

Parameters

Name
Type
Required
Description
area
string
Yes
The location of the spinner. The only supported value is "preview", which places the spinner in front of the user's image.
visible
boolean
Yes
If true, the spinner is visible. If false, the spinner is not visible.

Returns

void
Copy link