Creates a new design in the Canva editor.
Usage
api.createDesign({design: {type: "Poster",},});
javascript
Parameters
Returns
void
Example
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>Canva Button</title><script src="https://sdk.canva.com/designbutton/v2/api.js"></script></head><body><button>Create a new design</button><script type="text/javascript">(async () => {if (!window.Canva || !window.Canva.DesignButton) {return;}const api = await window.Canva.DesignButton.initialize({apiKey: "API KEY GOES HERE",});const button = document.querySelector("button");button.onclick = () => {api.createDesign({design: {type: "Poster",},});};})();</script></body></html>
markup