The HTML-in-Canvas API origin trial
The HTML-in-Canvas API is a new experimental browser feature that allows developers to render DOM elements directly into a canvas. This bridges the gap between high-performance graphics and the accessibility and semantic features of standard web UI.
Why it matters
It enables complex, high-performance web applications like design tools or games to maintain full browser accessibility and integration features.
Thomas Nattestad X Natalia Markoborodova X GitHub LinkedIn Bluesky
For years, web developers have had to make a tough architectural choice when building complex, highly-interactive visual applications on the web/ Should you lean on the DOM for its rich semantic features or render directly to the <canvas> element for low-level graphics performance?
With the new experimental HTML-in-Canvas API —available now in origin trial —you don't have to choose. This API lets you draw DOM content directly into a 2D canvas or a WebGL/WebGPU texture while keeping the UI interactable, accessible, and hooked up to your favorite browser features. By combining HTML with low-level graphics processing, you can create experiences that were previously impossible.
To understand the power of this new API, it helps to look at the relative strengths of both the DOM and the Canvas.
Get smarter about the news
Sign up free for a feed built around what you actually care about, Dive Deeper research on any story, and the full text of every article.
Create free accountAlready have an account? Sign in