w

Cursor Canvas Tool

Paste a Cursor .canvas.tsx file, preview it in the browser, and publish a short shareable link.

Advanced Features

Compilation sandbox

Source is compiled in the browser with Sucrase, then evaluated against a module allowlist:

  • Allowed: cursor/canvas, react, react/jsx-runtime, react/jsx-dev-runtime
  • Any other import is blocked at compile time
  • The file must contain from "cursor/canvas" or from 'cursor/canvas'
  • Maximum source length is 200,000 characters

This is a preview sandbox, not a general React bundler. npm packages, CSS files, and local workspace imports will not resolve.

Theme

Preview follows the site light/dark color mode through useHostTheme. Rebuilds when you toggle the theme.

Interactive state

useCanvasState persists control values across rebuilds in the current page. Forms, pills, and toggles keep their values while you edit nearby source.

Live preview

metrics.canvas.tsx

Release health

99.2%
Uptime
142 ms
p95 latency
3
Open incidents
Deployed
canvas-host 1.4.2 is live in all regions.
Budget
Error budget burn is 18% for the current window.

Sample data · not connected to production

Charts, tables, and tasks

This preview implements the public cursor/canvas primitives used in Cursor galleries: layout, typography, cards, callouts, stats, tables, charts, todos, diffs, and DAG helpers.

Live preview

charts.canvas.tsx

Traffic mix

050100MonTueWedThuFri
Accepted
Rejected
213Total
IDE
CLI
Cloud

Sample telemetry · stacked series and donut share

Share pages

  • Share URLs look like /cursor-canvas/cv_xxxx
  • Each successful open increments viewCount (the author's own views do not)
  • Links can be public or password protected, and can expire
  • Open editor on the share page is shown only to the author (current session user)
  • Identical source MD5 from the same owner reuses the existing record and updates access settings (reused: true)
  • The author can delete links from Published links

Host actions

On the web, useCanvasAction opens Cursor through official deeplinks. newComposerChat prefills a chat prompt. Absolute openFile paths use cursor://file/...; workspace-relative paths cannot be resolved from the browser, so they also prefill a prompt. openAgent has no public deeplink, so it prefills a prompt with the conversation id. The OS still asks you to confirm before Cursor launches.

Next steps

Was this page helpful?