Skip to content

Renderers

A renderer turns a file into an interactive view. CanvasMesh ships 9 built-in renderers and picks one per canvas based on the file extension.

RendererExtensionsWhat it does
htmlhtml, htmSandboxed HTML with strict CSP
markdownmd, markdownGitHub-style Markdown
reactjsx, tsxIn-browser Babel transform for React components
svgsvgInline SVG
jsonjsonCollapsible JSON tree
texttxt, log, js, ts, css, py, go, rs, java, sh, yaml, yml, tomlSyntax-highlighted code
imagepng, jpg, jpeg, gif, webp, bmp, icoImage viewer with zoom/pan
notebookipynbJupyter notebook renderer
none(all others)Download-only, no preview

See Renderer types reference for a complete mapping.

You might want to render a .txt file as Markdown, or a .json file as plain text. Pass render on create or update:

await client.create({
title: 'README',
ext: 'txt',
content: '# Hello',
render: 'markdown',
});

Valid values: none, html, markdown, react, svg, json, text, image, notebook.

Every rendered canvas runs inside an iframe on an isolated subdomain (render-<slug>-<hash>.canvasmesh.dev) with:

  • Content-Security-Policy restricting network, script, and frame sources.
  • No access to cookies from the main canvasmesh.app domain.
  • Cross-Origin-Opener-Policy: same-origin.

This means canvases can execute JS (e.g. React, HTML) safely — even untrusted user content cannot access your account.

If the extension doesn’t match any renderer, the canvas is created with the none renderer — users see a download button but no preview.