Skip to content

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.

Grid NotesVersion 4.xMotionChecked 2026-11-06
Setup & agent config

Install and prerequisites

What your agent should install or configure before writing code with this pack.
Terminal
npm install @rive-app/react-webgl2
Packages:@rive-app/react-webgl2@rive-app/react-canvas

Choose @rive-app/react-webgl2 for vector feathering and shaders, or @rive-app/react-canvas when WebGL context count is constrained.

Framework setup

Production-ready wiring for React 19, Next.js App Router and Tailwind CSS v4.

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.

components/rive-toggle.tsx
"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

Real-world traps — version mismatches, licence boundaries, main-thread stalls and CSS layer rules — that trip AI agents up.
  1. Free-plan exports show a Rive splash watermark

    While the React runtime (@rive-app/react-webgl2) is MIT-licensed and free, .riv files exported from Rive's free editor plan play a Rive splash screen at startup.

  2. No official MCP server — use the Rive CLI

    Rive does not publish an official MCP server. AI agents inspect and build .riv files through the official Rive CLI (rive.app/agents); ignore unverified third-party Rive MCP wrappers.

  3. Browser WebGL context limit

    Browsers cap simultaneous WebGL contexts (often 8–16 per page). Do not mount dozens of separate @rive-app/react-webgl2 canvases in a grid; use @rive-app/react-canvas or pause/unmount off-screen instances.

Accessibility and reduced motion

How to keep animations and interactive components accessible across keyboard, screen readers and prefers-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.