Skip to main content
Both players ship a React entry point with the same component:
ClayzoPlayer renders a <canvas>, creates the player when it mounts, and disposes it when it unmounts. Any canvas attribute passes through.

Props

The player is recreated when document or options change identity. Build options once with useMemo, and keep callbacks behind refs or in useCallback, so a re-render doesn’t tear down and rebuild the renderer.

Driving inputs

The hook

useClayzoPlayer is the component’s underlying hook, for when you own the canvas element yourself. It takes a canvas ref, the document and the options, and manages the same create-and-dispose lifecycle.

Loading a bundle

Next.js

The component must be a client component ("use client"). Nothing else is needed for either player: the WebGL player has nothing to serve, and the CanvasKit player loads Skia at runtime rather than through the bundler. Importing a .json document directly works with the default configuration.

Reduced motion

Reduced motion is about autoplay, not about refusing to respond. A reasonable reading is to leave the timeline paused and let the pointer bindings keep running: