toggleSpinner

API reference for the "toggleSpinner" method.

Shows or hides a loading spinner.

Usage

const canva = window.canva.init();
canva.onReady(async (opts) => {
// Show the spinner
canva.toggleSpinner("preview", true);
// Hide the spinner
// canva.toggleSpinner('preview', false);
});

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