Getting Started
Installation
Install Prism and enable native HTML-in-Canvas support in Chromium-based browsers.
Install the package from the public package root:
npm i @synthesisengineering/prismUse the package root for app code:
import { CanvasRuntime } from "@synthesisengineering/prism";Subpath imports are not supported public API.
Enable native rendering
Native mode currently requires the browser's Canvas Draw Element flag.
Chrome:
- Open
chrome://flags/#canvas-draw-element. - Set Canvas Draw Element to Enabled.
- Relaunch Chrome.
Brave:
- Open
brave://flags/#canvas-draw-element. - Set Canvas Draw Element to Enabled.
- Relaunch Brave.
The flag is browser-local. Enabling it in Chrome does not enable it in Brave.
Fallback
Prism can run in fallback mode for compatibility, but fallback is lower fidelity than native HTML-in-Canvas. Treat it as a compatibility path, not the definition of Prism's rendering behavior.