This is the complete prop reference for FragCanvas — the main adapter entrypoint for using Motion GPU in Svelte, React, and Vue.
Import
Usage
Adapter-specific naming differences (class vs className, style type, children/slots, and canvas handle access) are listed below.
Props
Required
Rendering
Color pipeline
color controls the private final presentation stage. It is not a composable render pass; it always runs after the base scene and after all post-scene render passes.
Khronos PBR Neutral is an SDR tone mapper: it consumes non-negative linear Rec.709 HDR color and returns linear Rec.709 in [0, 1]. Explicit dynamicRange: 'hdr' with toneMapping: 'khronos-pbr-neutral' is rejected because that combination asks for HDR presentation after an SDR tone mapper.
Post-processing
WebGPU configuration
Error handling
Error history behavior
- History is disabled when
errorHistoryLimit <= 0. - History stores the latest
Nreports whenerrorHistoryLimit > 0. - Consecutive identical reports are deduplicated (
phase/title/message/rawMessagekey). - Reducing
errorHistoryLimittrims existing history immediately. onErrorHistoryreceives a fresh snapshot array; mutating it cannot change internal runtime history.
Styling and children
FragCanvas is canvas-facing: DOM attributes passed to the component target the internal <canvas>, not the implementation wrapper. Wrap FragCanvas in your own element when you need container-level layout classes or styles.
width and height canvas attributes are intentionally not forwarded. Motion GPU controls the backing-store size from CSS size × dpr; use CSS/container sizing plus the dpr prop instead.
Lifecycle
Canvas sizing
FragCanvas renders a <canvas> inside an implementation wrapper <div>. Native DOM props passed to FragCanvas are applied to the canvas, while the wrapper remains private to provide stable layout, clipping, context children, and error UI. The canvas fills its container using width: 100%; height: 100% CSS. The container determines the effective canvas dimensions.
The physical size (GPU resolution) is containerSize × dpr.