Canva Code
|
This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production. |
This page was checked against the official Canva Help Center and newsroom on 2026-11-07. Canva Code is a feature of Canva AI that turns a plain-language prompt into a working interactive design, such as a landing page, a dashboard, a quiz, a calculator or a form, without the person writing code. Version 2.0, including HTML import, was announced with Canva AI 2.0 on 2026-04-16 and became available to the whole Canva community on 2026-07-14, so it is generally available; the newsroom announcement lists Free, Pro, Business, Enterprise and Education users, and prices are published only at https://www.canva.com/pricing/. Canva Code belongs to the Premium tier of AI features, which means each generation draws on the AI allowance described on Plans, Pricing and AI Allowance. The conversational Canva AI 2.0 launched as a research preview on 2026-04-16 and has no published general-availability date; Canva Code 2.0 is generally available without it.
The running example is Bookshelf, the book catalogue and reading-list app designed in the Figma sub-section. Its launch campaign needs a small "reading streak" widget that counts how many days in a row a reader has logged a reading session. It is built with a prompt, refined, added to the launch material, connected to a Sheet and published.
What Canva Code is
Canva Code generates web code (HTML, CSS and JavaScript) from a description and shows the running result next to a chat thread. The result is not a separate coding environment: it opens in the Canva editor, where colours, fonts, text and images are edited with the same toolbar as any other design and where the Brand Kit applies. The newsroom announcement describes the aim as visual control over AI-generated code: output that works like a website or an app but looks like it came from your brand.
The Help Center names two ways to use it.
| Code design | Code element | |
|---|---|---|
Start |
Code on the Canva homepage, which opens the editor |
Canva AI on the homepage, type the prompt, then the Code button |
Result |
A full interactive experience: landing page, dashboard, portfolio |
A single component: quiz, calculator, chart, countdown |
Where it ends up |
Edited in the editor and published as a responsive website |
Added with Use in a design to Presentations, Whiteboards and other design types, reusable across designs |
The 2026-07-14 general-availability announcement lists three starting points: a prompt, one of more than 50 Canva Code templates, or imported HTML. HTML import brings work built elsewhere, including in other AI assistants, into Canva as an editable design, so you can continue without rebuilding it. Canva Code can also be created inside other projects, for instance as a page in a whiteboard or a deck.
From prompt to widget
The mechanism is a loop. Every prompt in the thread produces a new version of the code; the editor shows the result; you either accept it, edit it by hand or prompt again.
The Help Center explains that Canva Code uses diff-based editing: only the lines that must change are updated rather than regenerating the whole block. If you do not see lines of code changing after you send a prompt, Canva is applying the minimal change in the background and a new version appears when it finishes. Canva Code only follows the description you entered, so more context and instruction produce a better result. The announcement also states that code generation time was reduced by 75% and the median time from prompt to published site is 30% faster.
Procedure 1: build the Bookshelf reading streak widget
-
From the Canva homepage select Canva AI.
-
In the Prompt box describe the widget, for example the prompt shown below.
-
Select the </> Code button under the prompt bar so the request is generated as code.
-
Press Enter or select the submit button. Canva AI prepares the interactive design.
-
Test the result in the preview. Interactivity works when the design is viewed on Canva or published as a website.
-
Prompt refinements in the chat box in the side panel, for example "make the streak number larger and use the Bookshelf indigo and amber".
-
Select Use in a design and, under Add as an element to, choose a design type to add the widget as an interactive Code element.
A prompt for the Bookshelf widget:
Design an interactive reading streak widget for a book app called Bookshelf.
Show the number of consecutive days the reader has logged reading, a "Log today"
button that adds one day, and a small row of the last seven days with a dot for each
day that was logged. Use indigo and amber on a white card. Keep it responsive.
Viewing and copying the generated code
The code is visible and copyable. In a Canva Code thread, turn on the Show code toggle and select Copy code to put it on the clipboard (desktop browser; the mobile app has the same steps according to the Help Center). Inside an editor design, select the Code design and choose Code, then Copy code. Copied code can be used in your own projects and adapted for external tools or workflows. It cannot be exported as a file and cannot be edited directly inside Canva: changes inside Canva are made by prompting or with the editor toolbar.
An illustrative sketch of the kind of HTML such a prompt produces is shown below. It is a hand-written simplification to explain the idea, not a captured Canva output; the code Canva generates differs in structure and size.
<div class="streak-card">
<p class="streak-count" id="count">0</p>
<p class="streak-label">day streak</p>
<div class="streak-days" id="days"></div>
<button id="log">Log today</button>
</div>
<script>
// Last seven days, oldest first; true means a reading session was logged.
const days = [false, false, false, false, false, false, false];
const count = document.getElementById("count");
const dots = document.getElementById("days");
function render() {
dots.innerHTML = days.map(d => `<span class="dot ${d ? "on" : ""}"></span>`).join("");
let streak = 0;
for (let i = days.length - 1; i >= 0 && days[i]; i--) streak++;
count.textContent = streak;
}
document.getElementById("log").addEventListener("click", () => {
days.shift();
days.push(true);
render();
});
render();
</script>
Editing a Code design or element
Canva Code results are edited with the normal editor tools; the exact options depend on what was generated.
-
Code designs (pages). Select the page. If everything is directly editable you can edit supported text, change fonts, colours and styling in the toolbar, and resize and reposition layout sections. For anything that cannot be changed directly, select it, choose Canva AI in the toolbar and describe the change, for example "switch chart to a dashboard" or "change labels to images". You can also ask Canva AI to refine the whole page.
-
Media. Replace images with Photos and Graphics from Elements or with your own Uploads: drag onto an image and use Replace in the toolbar. You can attach uploads to a prompt, either as a style reference or to embed directly, for example "use this logo in the design".
-
Code elements. Select the element and choose Edit in the toolbar. The Edit panel lets you change the title and subtitle and toggle the export button, search bar and tag filters, when the generated element offers them. A colour tile opens the colour panel and the background and button colours adjust automatically; the font menu includes Brand Kit fonts and applies to the whole element. Animate adds visual effects and Position opens Arrange and Layers.
-
Scope of AI changes. "Change this across all designs" prompts do not apply to Code designs. AI updates affect only the page you are editing, each page has its own chat history, and bulk updates across several designs are not supported.
For the editor itself see Editor Tour; for animation see Animation and Transitions.
Versions
Each time you update a Code design by prompting, Canva saves a new version inside the same chat thread. To open them, go to Canva AI on the homepage, select </> Code under the prompt bar to list Canva Code chats in the sidebar (they carry a </> icon), open a thread and browse Version 1, Version 2 and so on. Select a version and Use in a design to continue editing from that earlier iteration. Chats with Canva Code are visible only to you; a design created with Use in a design can be shared with Share.
Saving data to Sheets
Forms, to-do lists and calculators built with Canva Code save inputs and responses automatically to a connected Canva Sheet. Nothing needs switching on: every creation connects to its own Sheet. The rules from the Help Center are:
-
Data flows one way, from the creation to the Sheet. Edits made in the Sheet do not sync back and may be overwritten.
-
Open the Data tab (in the editor, select the Code element and choose Data in the toolbar) and select the Sheet name to open it; use Data then Refresh to update it. If nothing appears, add a test entry and refresh.
-
To collect responses, publish and share the published link; responses appear in the connected Sheet.
-
Each version of a creation stores its data in its own Sheet, and duplicates start with a fresh Sheet. Responses collected in a design are stored separately from those in the homepage thread, even for the same code.
-
A Sheet supports up to 999 rows and 104 columns.
-
For forms, the file owner receives email notifications by default; recipients cannot currently be chosen, and each recipient receives at most five notification emails a day. They can be switched off in the Sheet under Data, Settings, Notifications.
-
Connecting your own Sheet is not available yet; the Help Center says a custom Data Connector is coming.
-
You are responsible for privacy law, consent and access for any data you collect.
For Bookshelf, the reading streak widget logs each "Log today" press into its Sheet, which can then feed the reading-challenge tracker described on Canva Sheets.
Procedure 2: publish the widget as a website
-
Open the code thread of the widget.
-
Select Publish in the top-right corner of the Code window.
-
Under Site address (URL) customise the address.
-
Select Settings. In the Title and favicon dialog enter the website title, toggle Visible in search engines and set Password protection if needed.
-
Select Continue to publish, then Publish. A confirmation message links to the live site.
-
Back in the thread, a green Live badge shows the URL; use the copy icon to share it.
-
To update, change the code in the same thread and select Publish again: the original URL is updated.
-
To remove the site, open the thread and select Unpublish.
Facts that surprise people:
-
A site published from a code thread does not appear in your Designs list. Find it in the thread or under Admin Settings, then Domains.
-
Use in a design followed by publishing the design creates a separate URL. Each code thread has exactly one URL.
-
Deleting the code thread unpublishes the site and permanently removes the URL and content.
-
If a large or complex site will not publish, an oversized widget may be the cause. Ask Canva AI in the same chat to simplify it and reduce oversized widgets, or to split it into two smaller publishable sites; each published site then has its own URL.
-
The announcement says you can publish to a free domain, buy a custom domain inside Canva, or share within your organisation using single sign-on. Domains in general are covered on Websites.
Limitations, ownership and access
-
Canva Code supports all languages available on Canva, except for users in canva.cn.
-
Code can be copied and reused externally but cannot be exported as a file or edited directly inside Canva.
-
Interactivity works in Canva and on published websites, not in downloaded static files.
-
The Help Center states that, as between you and Canva and to the extent permitted by law, you own your input and output to Canva AI features including Canva Code; read the AI Product Terms for the full wording.
-
Admins, teachers and brand designers can choose who in a team or class can use Canva Code. If it is missing from your homepage, an admin may have turned it off for a team, enterprise or education account, or access is restricted by other settings. See Administration, Enterprise and Security.
Where older guides are outdated
Canva Code launched about a year before the 2.0 announcement, and printed Canva guides predate it entirely, so they say nothing about prompting working widgets, publishing code as a website, HTML import, versions with copyable code, or the automatic Sheet behind each creation. Anything older that describes Canva Code as an experiment or an early release no longer matches the current state: since 2026-07-14 version 2.0 is available to all users, with the announcement counting more than six million sites created in its first year.