HTML Canvas Examples
21 open-source HTML canvas examples in 2D, WebGL, and
WebGPU, each with annotated source you can fork. Every demo uses the
WICG HTML-in-Canvas spec's drawElementImage(), which draws
live DOM elements into the canvas with real CSS rendering and working
hit testing. Building glass UI? Start with the
liquid glass effect tutorial.
vgpu WebGPU Shader on Live HTML
Shade live HTML with Vercel vgpu: drawElementImage paints a real DOM card into canvas, a WebGPU foil shader warps it on hover, and the same pass snapshots for OG images via vgpu/node. An HTML-in-Canvas demo by En Dash.
Margin Dragon
A watercolour dragon swims through a page of real HTML text that re-flows around it every frame, and its fire burns holes in the live page. By Baked Design Studio.
Snowfall
A Japanese winter poster where snow settles on real, live HTML type, read from its pixels. Brush it off, write your own word, start a blizzard. By Baked Design Studio.
Wishing Pond
A real web form at the bottom of a koi pond: type a wish, toss a coin and watch your words sink, while ripples, caustics and weather bend the live HTML. By Baked Design Studio.
Elastic Bulge
Mouse-driven elastic displacement effect: a WebGL2 shader warps laid-out HTML content with a radial bulge and soft drop-shadow that follow the pointer.
3D Room with Live Web Content
A Three.js first-person 3D room where live HTML elements are rendered as textures on surfaces: a monitor dashboard, a styled poster, and a TV playing CSS animations.
Accessible Charts
Bar and pie charts with real HTML labels, ARIA roles, keyboard navigation, and hand-drawn focus rings.
CSS-to-Shader Pipeline
Pick a source (live form, article, or CSS-painted scene) and a fragment shader (CRT, chromatic, halftone, ASCII, and more). The DOM stays live under the shader, so typing, Tab, and hover still work.
Frosted Glass Backdrop
Draggable frosted glass panel with custom gaussian, directional, and tilt-shift blur effects composited between HTML rendering layers.
Hello World
The simplest HTML-in-Canvas demo: a styled div drawn into canvas with drawElementImage, with the minimal boilerplate annotated.
HTML-to-Image Export
Social card / OG image generator. Edit HTML content and export as PNG or JPEG via canvas.toBlob(). A native replacement for html2canvas.
HTML Video Recording
Record animated HTML as WebM video. Type a message, watch it animate with CSS, hit record, and download the clip via canvas.captureStream() + MediaRecorder.
Interactive Form
A full HTML form rendered inside canvas. Inputs, checkboxes, selects, sliders, and buttons stay interactive: typing, clicking, and tabbing work natively.
Internationalized Text
Side-by-side comparison of ctx.fillText() vs drawElementImage for complex scripts: RTL, vertical CJK, Thai diacritics, mixed-direction, emoji with skin tones, and ruby annotations.
Liquid Glass Distortion
A styled HTML card rendered into a WebGL canvas with a real-time liquid glass refraction shader. Mouse movement warps the glass while the HTML content underneath stays live and interactive.
Morphing Text Transitions
Two HTML text layouts morph into each other via canvas pixel manipulation. Crossfade, dissolve, wave wipe, and pixel sort work across different DOM structures, which CSS alone can't do.
Multi-Element Composition
Multiple draggable canvas children drawn at different positions with transforms, showing z-ordering and changedElements paint data.
OffscreenCanvas Worker
Captures HTML as a transferable ElementImage and sends it to a Web Worker for rendering on an OffscreenCanvas, using postMessage to communicate with the worker.
Page Curl / Book Turn
Two HTML pages drawn as WebGL textures on planes that simulate a page curl. Drag to turn the page. The back shows the next page's content, correctly mirrored.
Pixel Disintegration
An HTML profile card rendered into canvas, then broken into thousands of color-sampled particles on click. Particles drift outward with simple physics and reassemble on a second click. A Thanos snap built on getImageData.
Rich Text Canvas Editor
A contenteditable div rendered into canvas with real-time drop shadow, neon glow, and outline effects beyond what CSS offers. Edit text with native browser selection, copy/paste, and undo.
No demos match the current filters.