Clipboard mode
Clipboard mode returns Figma clipboard HTML — the same format Figma uses internally when you copy layers. Write it to your system clipboard and paste into Figma.
How it works
Set outputMode to "clipboard" in your request.
The API returns Figma clipboard HTML that you can write to the system clipboard and paste into Figma.
Example
curl -X POST https://api.coderender.app/api/html \
-H "Content-Type: application/json" \
-H "Authorization: Bearer cr_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-d ''{
"schemaVersion": "1.0",
"html": "<div style=\"padding:24px; background:#fff\">...</div>",
"vpWidth": 1280,
"vpHeight": 900,
"outputMode": "clipboard"
}'
The html field accepts any valid HTML string — a full document or a fragment with inline styles.
Response
Returns 200 OK:
{
"clipboardHtml": "<meta charset='utf-8'>...",
"stats": { "nodes": 8, "images": 0, "frames": 3, "text": 3 }
} Pasting into Figma
The clipboardHtml value must be written to the system clipboard
as the text/html MIME type — not pasted as literal text.
Then press Ctrl+V (Cmd+V on Mac) in Figma.
const blob = new Blob([result.clipboardHtml], { type: "text/html" });
const item = new ClipboardItem({ "text/html": blob });
await navigator.clipboard.write([item]);
In Node.js or native environments, use the platform clipboard API
(e.g. pbcopy on macOS, xclip on Linux).