The page content; components inside it can register scenes.
className?
string
Class applied to the canvas element. When set, the default fixed-fullscreen inline styles are not applied - the class is expected to position the canvas itself.
layout?
"fixed" | "absolute"
How the canvas is kept over the viewport. 'absolute' avoids scene lag during momentum scrolling on touch devices by letting the compositor scroll the canvas with the page; see ScrollRendererOptions.layout in wtc-gl for the full trade-offs. In this mode the canvas is positioned relative to its nearest positioned ancestor, so mount the provider where that ancestor is the document (no position: relative wrapper between it and <body>). Captured once on mount. Default'fixed'
onAfterRender?
(delta) => void
Called every frame after the scenes render, with the milliseconds since the last frame (at most 50). The latest callback is always used.
onBeforeRender?
(delta) => void
Called every frame before the scenes render, with the milliseconds since the last frame (at most 50). The latest callback is always used.
overscan?
number
Overscan fraction for layout: 'absolute'; see ScrollRendererOptions.overscan. Captured once on mount. Default0.25
playing?
boolean
Whether the render loop runs. Defaulttrue
rendererProps?
Omit<Partial<RendererOptions>, "canvas">
Props forwarded to the underlying Renderer. canvas is always the provider's own canvas element and cannot be overridden. Captured once on mount - changing this prop after mount has no effect.
style?
CSSProperties
Inline styles merged over the default fixed-fullscreen canvas styles.