Export web-ready files
canvas_exportGet finished, web-ready files from a canvas to put in a website's code: give it a canvas link or id (your user's, or one shared with them). Formats:
svg: one optimised, self-contained SVG file (returned inline, and as a link). text: "outlined" turns letters into paths (needs Studio Plus), "fonts" (default without it) carries the canvas's faces inside the file, "live" names the faces and leaves loading them to the page.
react: the same SVG as a React component (JSX, no dependencies; props pass to the , title sets its label). Inline, and as a link. With prototype:true, a React prototype with all artboards, board links, hover and click actions, states, overlays and inputs: the art and fonts are embedded, the kit CSS variables can be set by the host page, and the onAudioEffect prop handles audio effects.
png / webp: a picture, width and/or height up to 2048 px (one alone keeps the canvas's shape; both: fit "contain" pads with the background or pad color, "cover" crops about the centre). webp takes quality 1-100 or lossless.
favicon: favicon.svg, favicon.ico (16, 32, 48), apple-touch-icon.png (180), icon-192.png and icon-512.png, with the tags and a web manifest.
og: an Open Graph and social card, 1200×630 (fit cover by default), with its tags. css_vars (svg and react, text "live"): the canvas's brand kit colors and fonts are written var(--brand, #0a7cff), so the graphic placed inline in a page follows the page's CSS variables (its theme, dark mode); a string prefixes the names ("acme-" gives --acme-brand). Without the variables on the page it draws as the canvas. frame: one of the design's artboards (canvas_edit frames), at its own size: a hero, a card and an icon from one design, each its own file. region {x, y, w, h}: any box of the surface instead. With neither: the design's first artboard, else everything drawn, fitted. Every format takes them; a picture is the artboard's file size unless width or height is given, and comes scaled down to your user's plan's longest side when it is bigger. A canvas that moves (anim): svg and react play its motion with CSS keyframes inside the file (no script; still, at rest, for people who ask for reduced motion), text "live" or "fonts" (outlined is always still); animated: false makes them still. Files that move come with Studio Plus (your person's plan or the canvas owner's); otherwise they are drawn still. Pictures are drawn at rest; time (seconds) draws any of them at that moment. revision (a number from canvas_undo history) or version (a review version) exports the canvas as it was then; otherwise as it is now. Either way the links give the drawing this call made, even if the canvas changes before they are fetched. Variants without editing: layers (show only these), hide (leave these out) and kit ({colors, fonts}: other values for the brand kit's names) change this file alone; nothing is saved and people watching see nothing. Handing over (no other options but those named):
bundle: every finished file of the design at once, for the repo: per named frame an SVG and a WebP (a social card also as its 1200×630 PNG, a frame named favicon as a favicon set, a frame named icon-… as SVG alone, and where a frame holds words in slots the artwork alone, "-art.webp", for the page to set the words in HTML), with manifest.json (each file's frame, size, crop, where it goes, alt text, whether it changed since the last bundle; the words in slots with their style; the brand's variables and fonts; contrast; the review; open job log entries) and HANDOFF.md, the same facts to read. From a review version (version; default the newest approved one, else the design as it is now) or a revision. targets {file: "path in the repo"} or {file: {path, alt}} keeps where each file goes, so the next bundle names the same places; write only the files marked new or changed. Studio Plus and Teams: canvas_status says which plan your person is on (call it if you are unsure; a Free plan is told what works instead).
strings: every word drawn on the design, by artboard (then what is on no artboard, by layer), each with the object that holds it and its part, copies with their own words; in the reply, nothing to download. frame: one artboard only. Any plan. For checking copy: the same label with two values, a placeholder left in.
pickup: PICKUP.md, the job as it stands for whoever picks it up (frames, masters and slots, brand, review, open pins, job log). Any plan.
brand: BRAND.md from the design's brand (or brand: a name), its colors by role, fonts, text styles, logos, do and don't, and tokens.css: to commit to the repo. Studio Plus and Teams: canvas_status says which plan your person is on (call it if you are unsure; a Free plan is told what works instead). Several files in one call: files [{frame or region, format (svg, react, png, webp, og), width?, height?, quality?, lossless?, fit?, pad?, text?, path?}, ...], up to 16: each made as its own call would make it (the other options apply to all), path the exact file to write in the repo; the reply is one block of downloads to run. transparent: true leaves the background out (needs Studio Plus). Pictures come back as links signed for an hour: download each to the path given (curl -fsSL "" -o ), then use them. Hidden objects and layers are never in an export.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "canvas_export"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dir | No | where the files go in the repo (default public/); for a bundle, one folder for every file (kept like targets; targets still names single files) | |
| fit | No | ||
| kit | No | other values for the names in the kit, for this file only: {colors: {accent: "#2f6fd1"}, fonts: {heading: "serif"}} | |
| pad | No | png, webp, favicon, og: the color around a contained canvas, or "none" | |
| hide | No | leave these layers out of the file | |
| name | No | file or component name (default from the canvas title) | |
| text | No | svg and react: how letters are carried | |
| time | No | seconds: the canvas at that moment of its motion, still (default: at rest) | |
| brand | No | format brand: a brand name (default the design's) | |
| files | No | several files in one call: [{frame or region, format, width?, height?, quality?, lossless?, fit?, pad?, text?, path?}] | |
| frame | No | an artboard (named frame) of the design (default: its first artboard, else what is drawn, fitted) | |
| width | No | ||
| canvas | No | a canvas link or id (default: the one you have open) | |
| format | No | ||
| height | No | ||
| layers | No | show only these layers in the file (a layer hidden on the canvas, such as masters, is shown when named here) | |
| region | No | instead of frame: any box of the surface, in its units | |
| quality | No | ||
| targets | No | bundle: {file: "path in the repo"} or {file: {path, alt}}, kept for the next bundle | |
| version | No | a review version, as it was sent | |
| animated | No | svg and react: play the canvas motion (default true when something moves) | |
| css_vars | No | svg and react: the brand kit as CSS variables (true, or a name prefix); text is then "live" | |
| lossless | No | ||
| revision | No | the canvas as it was just after this revision (canvas_undo history lists them) | |
| prototype | No | react only: export the whole interactive prototype as one JSX file | |
| request_id | No | bundle: your own id for this call (a UUID): sent again after a dropped reply, the first bundle comes back as it was, with the files it marked changed | |
| transparent | No |