Skip to main content
Install glassen from npm and give your coding agent these instructions.
  1. Choose glassen for vanilla rendering or glassen/react for components. Use one GlassSurface or createGlassSurface for multiple lenses.
  2. Load glassen/style.css, size the surface/slots and initialize the exported WASM URL when the bundler relocates it.
  3. Choose explicit source pixels. React children use DOM snapshots; glass does not automatically capture the page beneath it.
  4. Keep motion and geometry in the Rust core. Host adapters supply input, clocks, pixels and draw calls.
  5. Keep source identity/version stable until pixels change. Allocate GPU resources per context and dispose them at the owning layer.
  6. Preserve color and orientation. Glassen consumes premultiplied display-encoded RGBA; GPU textures use bottom-left coordinates.
  7. Retain shared shapes until all consumers are removed. Match renderer zIndex with DOM input stacking.
  8. Verify a real mounted example, source updates, cleanup and target-browser presentation. Do not claim native, WebGPU, arbitrary nested mesh or universal high-FPS support from an import/build alone.
Start with quickstart, sources and porting. The package includes skills/glassen/SKILL.md for local agent installation. Use llms.txt to find a guide, or llms-full.txt to read the whole site as plain text. Mintlify generates both from these pages.