canvas-anywhere
Render .canvas.tsx files in any browser, pixel-identical to Cursor's canvas panel.
Why this exists: Cursor Canvas quality comes from its runtime (React components + design tokens), which only lives inside Cursor. This skill serves that same runtime from the local Cursor install to any browser, so the same .canvas.tsx file renders identically everywhere. Write once with the cursor/canvas API, view anywhere.
Quick start
node <skill-dir>/scripts/canvas-serve.js path/to/file.canvas.tsx --watch --open
# → http://127.0.0.1:4173/ (opens in default browser)
Requirements:
- Node ≥ 18, esbuild (
npm install in the skill dir, or any reachable esbuild)
- A local Cursor install (the runtime file
canvas-runtime.esm.js is read from
/Applications/Cursor.app/...; override with CURSOR_CANVAS_RUNTIME=/path/to/file)
No network access at runtime. The server binds 127.0.0.1 only.
When to use a canvas (portable judgment from Cursor's own canvas skill)
The trigger is user intent, not response shape. Use when the agent produces a
standalone analytical artifact: quantitative analyses, billing/security/architecture
reviews with structured findings, data-heavy tables, timelines, anything where the
data IS the deliverable.
Do NOT use for: work requested in a specific tool, specific deliverables (draft reply,
code fix, PR), targeted debugging, short answers. If you would write a large markdown
table, that is a signal to consider a canvas.
Authoring rules (same as Cursor canvas skill)
- One
.canvas.tsx file, default-export the top component.
- Import only from
cursor/canvas. No npm packages, no fetch, no Node built-ins.
- Embed all data inline.
- Read
<skill-dir>/sdk/*.d.ts for the exact component surface (Card, Table, Stat,
Pill, UsageBar, DiffView, charts, hooks). Referencing a non-existent export is the
most common runtime error.
- Never render empty states; label every plot (metric title, axis units, legend,
source caption).
- Anti-slop: no gradients, no emoji icons, no box-shadows, no rainbow coloring, no
wall of identical cards. Color from
useHostTheme() tokens only.
Workflow
- Decide (judgment above).
- Write the
.canvas.tsx next to the relevant work (any directory).
- Preview: run canvas-serve (below). Check the browser console — the page shows a
bootstrap error card if the module failed;
_status endpoint reports build state.
- Iterate with
--watch (rebuild on save; refresh browser).
- Deliver the file path + the one-liner command so the user can re-open it anytime.
canvas-serve reference
node scripts/canvas-serve.js <file.canvas.tsx> [--watch] [--open]
env: PORT (default 4173), CURSOR_CANVAS_RUNTIME (runtime override)
| endpoint |
serves |
/ |
HTML shell (same one Cursor serves: focus rings, scrollbar, padding) |
/_runtime |
canvas-runtime.esm.js (React + all components, self-contained) |
/_app |
the esbuild-transformed canvas module |
/_status |
{ok, error} build state |
The transform matches Cursor's internal one exactly (jsx: transform,
jsxFactory: React.createElement, imports stripped — the runtime injects
React/components as globals). useHostTheme() falls back to
prefers-color-scheme outside Cursor, so dark/light still works.
dispatchCanvasAction (canvas → IDE actions) is inert outside Cursor.
Hard-won authoring lessons (from real breakage)
- The #1 white-screen cause: inventing API that does not exist.
Table is
data-driven (headers + rows props) — there is no TableHead/TableRow/
TableHeaderCell. CardHeader takes plain-text children + a trailing
slot, not title/subtitle props. theme.tokens has six semantic groups
(text/bg/fill/stroke/accent/diff) — no spacing/surface. Always check
sdk/*.d.ts before writing.
- What makes a canvas look "Cursor-native" is not the CSS — it is using
the full component vocabulary: charts (Line/Bar/Pie) carry the page, Callout
gives tonal sections, striped Tables with category Swatches, Stat rows,
Pill clusters, TodoList for state. A canvas with only text + cards reads
flat no matter how correct the tokens are.
- Debug loop: serve with
--watch, poll /_status for build errors, use a
headless browser (or the browser console) for runtime errors. The runtime
renders a bootstrap error card on module failure — a blank page usually
means a component threw (bad props / missing export).
Limitations
- Needs a local Cursor install for the runtime file (it is Cursor proprietary;
this skill never bundles or downloads it — it only reads the user's own copy).
- IDE integrations (open file, insert text) do not work outside Cursor; pure
display canvases are unaffected.
1---2name: canvas-anywhere3description: "Render Cursor Canvas (.canvas.tsx) files in any browser with the authentic Cursor Canvas look — same runtime, same components, same theming. Use when the agent (any agent: Pi, Claude Code, Codex, OpenCode, Cursor) produces a standalone analytical artifact (quantitative analysis, security audit, architecture review, data-heavy tables/charts, timelines) and the user wants the Cursor-native canvas quality outside Cursor, or when previewing/debugging a .canvas.tsx file."4metadata:5 source: https://skillmd.com/skills/awesome-skills/canvas-anywhere6---78# canvas-anywhere910Render `.canvas.tsx` files in any browser, pixel-identical to Cursor's canvas panel.1112**Why this exists**: Cursor Canvas quality comes from its runtime (React components + design tokens), which only lives inside Cursor. This skill serves that same runtime from the local Cursor install to any browser, so the same `.canvas.tsx` file renders identically everywhere. Write once with the `cursor/canvas` API, view anywhere.1314## Quick start1516```bash17node <skill-dir>/scripts/canvas-serve.js path/to/file.canvas.tsx --watch --open18# → http://127.0.0.1:4173/ (opens in default browser)19```2021Requirements:22- Node ≥ 18, esbuild (`npm install` in the skill dir, or any reachable esbuild)23- A local Cursor install (the runtime file `canvas-runtime.esm.js` is read from24 `/Applications/Cursor.app/...`; override with `CURSOR_CANVAS_RUNTIME=/path/to/file`)2526No network access at runtime. The server binds 127.0.0.1 only.2728## When to use a canvas (portable judgment from Cursor's own canvas skill)2930The trigger is **user intent**, not response shape. Use when the agent produces a31**standalone analytical artifact**: quantitative analyses, billing/security/architecture32reviews with structured findings, data-heavy tables, timelines, anything where the33data IS the deliverable.3435Do NOT use for: work requested in a specific tool, specific deliverables (draft reply,36code fix, PR), targeted debugging, short answers. If you would write a large markdown37table, that is a signal to consider a canvas.3839## Authoring rules (same as Cursor canvas skill)4041- One `.canvas.tsx` file, default-export the top component.42- Import only from `cursor/canvas`. No npm packages, no fetch, no Node built-ins.43- Embed all data inline.44- Read `<skill-dir>/sdk/*.d.ts` for the exact component surface (Card, Table, Stat,45 Pill, UsageBar, DiffView, charts, hooks). Referencing a non-existent export is the46 most common runtime error.47- Never render empty states; label every plot (metric title, axis units, legend,48 source caption).49- Anti-slop: no gradients, no emoji icons, no box-shadows, no rainbow coloring, no50 wall of identical cards. Color from `useHostTheme()` tokens only.5152## Workflow53541. Decide (judgment above).552. Write the `.canvas.tsx` next to the relevant work (any directory).563. Preview: run canvas-serve (below). Check the browser console — the page shows a57 bootstrap error card if the module failed; `_status` endpoint reports build state.584. Iterate with `--watch` (rebuild on save; refresh browser).595. Deliver the file path + the one-liner command so the user can re-open it anytime.6061## canvas-serve reference6263```64node scripts/canvas-serve.js <file.canvas.tsx> [--watch] [--open]65env: PORT (default 4173), CURSOR_CANVAS_RUNTIME (runtime override)66```6768| endpoint | serves |69|---|---|70| `/` | HTML shell (same one Cursor serves: focus rings, scrollbar, padding) |71| `/_runtime` | canvas-runtime.esm.js (React + all components, self-contained) |72| `/_app` | the esbuild-transformed canvas module |73| `/_status` | `{ok, error}` build state |7475The transform matches Cursor's internal one exactly (`jsx: transform`,76`jsxFactory: React.createElement`, imports stripped — the runtime injects77React/components as globals). `useHostTheme()` falls back to78`prefers-color-scheme` outside Cursor, so dark/light still works.79`dispatchCanvasAction` (canvas → IDE actions) is inert outside Cursor.8081## Hard-won authoring lessons (from real breakage)8283- **The #1 white-screen cause**: inventing API that does not exist. `Table` is84 data-driven (`headers` + `rows` props) — there is no `TableHead`/`TableRow`/85 `TableHeaderCell`. `CardHeader` takes plain-text children + a `trailing`86 slot, not `title`/`subtitle` props. `theme.tokens` has six semantic groups87 (`text/bg/fill/stroke/accent/diff`) — no `spacing`/`surface`. Always check88 `sdk/*.d.ts` before writing.89- **What makes a canvas look "Cursor-native"** is not the CSS — it is using90 the full component vocabulary: charts (Line/Bar/Pie) carry the page, Callout91 gives tonal sections, striped Tables with category Swatches, Stat rows,92 Pill clusters, TodoList for state. A canvas with only text + cards reads93 flat no matter how correct the tokens are.94- **Debug loop**: serve with `--watch`, poll `/_status` for build errors, use a95 headless browser (or the browser console) for runtime errors. The runtime96 renders a bootstrap error card on module failure — a blank page usually97 means a component threw (bad props / missing export).9899## Limitations100101- Needs a local Cursor install for the runtime file (it is Cursor proprietary;102 this skill never bundles or downloads it — it only reads the user's own copy).103- IDE integrations (open file, insert text) do not work outside Cursor; pure104 display canvases are unaffected.