Rive Grid Notes
Interactive state-machine graphics packaged in compact `.riv` files and driven at 60–120 fps by Rive's open-source WebGL2 and Canvas runtimes.
Install and prerequisites
npm install @rive-app/react-webgl2@rive-app/react-webgl2@rive-app/react-canvasChoose @rive-app/react-webgl2 for vector feathering and shaders, or @rive-app/react-canvas when WebGL context count is constrained.
Framework setup
State machine with view-model inputs in React
Load a .riv file with useRive, bind a state machine by name, and drive its boolean or number inputs from React state or pointer events.
"use client";
import { useRive, useStateMachineInput } from "@rive-app/react-webgl2";
export function RiveToggle({ active }: { active: boolean }) {
const { rive, RiveComponent } = useRive({
src: "/animations/toggle.riv",
stateMachines: "ToggleMachine",
autoplay: true,
});
const input = useStateMachineInput(rive, "ToggleMachine", "isActive", active);
if (input && input.value !== active) {
input.value = active;
}
return (
<div aria-hidden="true" className="size-12">
<RiveComponent />
</div>
);
}Gotchas for agents
Free-plan exports show a Rive splash watermark
While the React runtime (
@rive-app/react-webgl2) is MIT-licensed and free,.rivfiles exported from Rive's free editor plan play a Rive splash screen at startup.No official MCP server — use the Rive CLI
Rive does not publish an official MCP server. AI agents inspect and build
.rivfiles through the official Rive CLI (rive.app/agents); ignore unverified third-party Rive MCP wrappers.Browser WebGL context limit
Browsers cap simultaneous WebGL contexts (often 8–16 per page). Do not mount dozens of separate
@rive-app/react-webgl2canvases in a grid; use@rive-app/react-canvasor pause/unmount off-screen instances.
Accessibility and reduced motion
Reduced motion
Pass autoplay: !prefersReducedMotion to useRive, or expose a reducedMotion boolean input in your Rive state machine that jumps directly to settled states without transitions.
Keyboard and screen readers
Never rely on internal Rive canvas hit-testing alone for buttons or controls. Wrap the <RiveComponent aria-hidden="true" /> inside a real <button> or <a href> so keyboard focus, Enter/Space activation and screen-reader roles work natively.
More Grid Notes
- LenisLightweight smooth-scroll engine that keeps native browser scrolling, sticky positioning and intersection observers intact, and pairs cleanly with GSAP ScrollTrigger.
- GSAPTimeline, scroll-linked and text-splitting animation engine. All plugins — including ScrollTrigger, SplitText and MorphSVG — are included under Webflow's no-charge licence.
- MotionMIT-licensed animation library for React and JavaScript (formerly Framer Motion), offering a 3.3 kB `motion/mini` WAAPI build as well as layout, gesture and spring animations.
- dotLottieLottieFiles' WebAssembly-powered player for `.lottie` archives and Lottie JSON animations, with official wrappers for React, Vue, Svelte and plain web canvas.
- NumberFlowDependency-free animated number component for React, Vue and Svelte that rolls individual digits into place and formats values with `Intl.NumberFormat`.
- Theatre.jsKeyframe timeline engine and visual studio overlay for choreographing Three.js / React Three Fiber cameras, lights and DOM properties.



