Introduction
Understand what Prism owns, what your app owns, and why the runtime exists.
Prism is runtime infrastructure for native HTML-in-Canvas surfaces.
Rather than providing a renderer, component framework, UI kit, design tool, state manager, or charting library, Prism manages the coordination required to make native HTML-in-Canvas surfaces practical inside real-time canvas applications.
HTML-in-Canvas is the platform primitive. Prism builds on the WICG HTML-in-Canvas work so applications can use managed HTML/CSS surfaces predictably inside canvas workflows.
Prism does not replace your renderer. It gives canvas applications managed DOM-authored surfaces.
Prism's core responsibilities
Your application remains the owner of data, templates, animation loops, interaction state, and render decisions. Prism handles the surface plumbing:
- Surface registration: manages
CanvasSurfaceregistration against aCanvasRuntime. - Paint lifecycle: coordinates when surfaces are painted and when they are ready to be drawn.
- Invalidation management: tracks when a surface needs repainting so applications do not have to coordinate raw paint state manually.
- CSS-pixel bounds: maintains surface bounds in CSS pixels for placement, sizing, and drawing alignment.
- Readiness and cleanup: tracks paint readiness and disposes of surfaces cleanly when they are no longer needed.
Why this infrastructure is necessary
The native browser primitive makes it possible to draw HTML/CSS-backed content into canvas. Prism provides the runtime layer around that primitive so applications can use managed surfaces predictably in real-time canvas workflows.
Current scope
Prism v1 is 2D-first. WebGL/WebGPU and renderer integrations are future-facing, not the current public API center.
Native HTML-in-Canvas currently requires a Chromium-based browser with the Canvas Draw Element flag enabled. Fallback mode is compatibility-only and lower fidelity; it does not define the public API.