About this site

This site started with one narrow question about <slot> inside <canvas>, and turned into a set of demos of what becomes possible when live HTML can be drawn anywhere a pixel can go.

How it started

In the HTML-in-canvas API, an element has to be a descendant of the <canvas> that draws it. That's a sensible rule for layout and hit testing, though it felt restrictive straight away. I wanted to know if you could put a <slot> inside a canvas in a shadow root and keep ordinary HTML outside the canvas, projecting it in only when you wanted to draw it.

That first experiment became <canvas-slot> and the bare declarative shadow DOM tests on /slot-bare/. It worked, and once ordinary light DOM could be projected into a 2D, WebGL or WebGPU canvas without losing clicks, typing, selection or accessibility, I kept asking what else would hold up.

From slots to the rest of the site

One experiment led to another. What if a fragment shader warped a live form (Shader CSS)? What if a lens magnified 4px text and kept it sharp (A lens over live DOM)? What if a form sat on simulated jelly or cloth (Physical UI), inside a three.js scene (3D form), inside a customisable <select> (Customisable select), over video (HTML overlays on video), inside a Qt, Flutter, Godot or Dear ImGui app (Native UI), or streamed live to a phone over WebRTC (Remote component)?

Every experiment on this site exists to push the boundaries of the API and show what it can do, including the places where it breaks or hits a limit.

Reusable libraries

Along the way, several of the experiments turned into small, standalone ES modules and custom elements that you can load on another site. Every file under /lib/ is served with Access-Control-Allow-Origin: * and licensed under Apache 2.0.

Who built it and how it works

I'm Paul Kinlan and I lead the Chrome and Open Web Developer Relations team at Google. This is my own playground of experiments and demos, not official Chrome documentation (that lives on developer.chrome.com).

There is no framework and no bundler. Every page is hand-written HTML and ES modules, shows its own running code in a "Show the code" listing, runs live checks in your browser, and lists what worked and what didn't. When something crashed or behaved unexpectedly, I recorded it in the friction log, the crash list and FINDINGS.md.

Browser support

HTML-in-canvas shipped in Chrome 157 on desktop, Android and WebView. For visitors on older Chrome 148 to 156 builds, this site also sends an Origin Trial token so the demos run without turning on a flag. In browsers without the API, every page falls back to plain HTML. See how to check or enable it.

Project links

Source codegithub.com/PaulKinlan/html-in-canvas-demos (Apache 2.0)
API explainergithub.com/WICG/html-in-canvas
Chrome docsHTML-in-Canvas: technical concepts
Chrome Statuschromestatus.com/feature/5172548013916160
Written findingsFINDINGS.md, /friction/, /crashes/
New pagesRSS feed, with the question, how it works and the findings of each page
AuthorPaul Kinlan (@PaulKinlan)