Skip to content

Types

ScrollRendererProviderProps ​

Defined in: scroll-renderer-provider.tsx:13

Props for ScrollRendererProvider.

Properties ​

PropertyTypeDescription
children?ReactNodeThe page content; components inside it can register scenes.
className?stringClass 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) => voidCalled every frame after the scenes render, with the milliseconds since the last frame (at most 50). The latest callback is always used.
onBeforeRender?(delta) => voidCalled every frame before the scenes render, with the milliseconds since the last frame (at most 50). The latest callback is always used.
overscan?numberOverscan fraction for layout: 'absolute'; see ScrollRendererOptions.overscan. Captured once on mount. Default 0.25
playing?booleanWhether the render loop runs. Default true
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?CSSPropertiesInline styles merged over the default fixed-fullscreen canvas styles.