Rive is a tool for making animations that react to what's happening: a button that squishes when you press it, a character that follows your cursor, a mascot that reacts while you talk to it. You design the animation in Rive's editor, and the same file then runs on websites, in iOS and Android apps, and in games built with Unity or Unreal. Where Three.js is mostly about 3D you write in code, Rive is about graphics you design first and then control with code. It's also one of the first creative tools built to work with coding agents. Below is how a Rive file is put together, where AI fits in, and some projects worth studying.

What Rive does

A video or GIF plays the same way every time. Rive files contain the animations and the logic that decides which one plays, when, and how it blends into the next, based on clicks, hovers or data from your app.

You build in the Rive Editor (browser or desktop), export a small .riv file, and load it on your site with Rive's open-source runtime. The same file works on the web, iOS, Android, Flutter, Unity and Unreal.

If you've used Lottie: it started as a way to play After Effects animations in apps. Rive's editor is built around interaction and live data from the start.

The six pieces of a Rive file

PieceWhat it isThink of it as
ArtboardThe canvas for one graphic, with its own size, shapes, animations and logicThe stage
Shapes and componentsVector artwork, images, text and reusable nested artboards. Bones and meshes let you rig a characterThe cast
TimelineOne animation made of keyframes: "blink", "wave", "idle breathing"A rehearsed move
State machineDecides which timeline plays and when to switch. Made of states, transitions with conditions, layers that run at once, and listeners for pointer and keyboard eventsThe director
View modelThe data the file exposes: numbers, text, colors, true/false, choices, triggers. Bound to properties in the sceneThe script your app hands in
RuntimeThe library that draws the file and lets your code read and set its dataThe theater

Older tutorials talk about state machine inputs. Rive now recommends data binding (view models) for new work, so start there.

How they work together

Picture a mascot with three timelines: idle, thinking and happy. The state machine starts in idle. A transition says "go to thinking when mood is thinking", another says "go to happy when celebrate fires", and Rive blends between them. Your website never touches the animations. It only changes data.

Loading a file takes a few lines. This is the official example, using a public demo file:

PROMPT / COPY-PASTE
import { Rive } from "@rive-app/webgl2";

const r = new Rive({
  src: "https://cdn.rive.app/animations/vehicles.riv",
  canvas: document.getElementById("canvas"),
  stateMachine: "bumpy",
  autoplay: true,
  autoBind: true,
  onLoad: () => r.resizeDrawingSurfaceToCanvas(),
});

Talking to it uses the view model. For the mascot above (property names are whatever you defined in the editor):

PROMPT / COPY-PASTE
const vm = r.viewModelInstance;
vm.enum("mood").value = "thinking";     // switch state
vm.string("message").value = "Hi!";     // update text in the graphic
vm.trigger("celebrate").trigger();      // fire a one-off reaction

That split is the useful part. The designer owns how it moves, the developer owns what it means, and the file is the contract between them.

Where AI fits

Rive now ships three official ways for AI to build inside the file, not just the code around it.

OptionWhere you promptWhat it can doGood for
AI AgentInside the Rive EditorShapes, layouts, rigging, timelines, state machines, view models, scripts. Every plan includes it; Free and Cadet have usage limitsHelp while you design by hand
Rive CLIClaude Code, Cursor or another coding agentWrites the scene in Rive's text format (RML), builds the .riv, previews, screenshots and checks its own workWorking from your code editor and Git
MCPClaude Code or Cursor, connected to the desktop editorEdits the open file: artboards, shapes, bones, state machines, data binding, scriptsRepetitive setup, like a state machine with dozens of states

rive create even writes a CLAUDE.md into the new project, so your agent knows how to look up types and verify what it built. Rive's own advice is to build in stages (rough layout, then structure, then detail) so you can catch problems early. Timing, character and feel are still your call.

Pick your setup

If your site is...UseWhy
Plain HTML, Webflow or WordPress@rive-app/webgl2 (script tag or npm)Draws with the same renderer as the editor, so it looks the way you designed it
React or Next.js@rive-app/react-webgl2Hooks for loading the file and reading or setting view model data
A page with many small graphics@rive-app/canvasUses the browser's 2D renderer, with no limit on graphics per page, but doesn't match every editor feature
Simple graphics with no text, layouts, scripts or audio@rive-app/canvas-liteThe smallest package

The packages share the same API, so switching is a one-line import change. On the Free plan, exported .riv files show a Rive splash screen. The $9/month Cadet plan removes it.

Ship it without surprises

  • Name the state machine. Pass stateMachine when you load. Without it, the runtime may only play the first timeline it finds.
  • Keep it sharp. Call resizeDrawingSurfaceToCanvas() on load and on window resize, or it'll look blurry on high-density screens.
  • Give the container a size. The React canvas sizes itself to its parent. If nothing shows up, the parent has no width or height.
  • Several graphics on one page? Browsers cap WebGL contexts, so with webgl2 set useOffscreenRenderer: true to share one.
  • Make it accessible. A canvas is invisible to screen readers. Rive can build an accessible layer from roles and labels you set in the editor, but it's opt-in and experimental. Keep important text and buttons in normal HTML too.
  • Respect reduced motion. Check prefers-reduced-motion and show a calm or final state instead of the full animation.

Projects worth studying

  • Duolingo's Video Call with Lily: an AI conversation partner whose mouth, expressions and camera moves run on a Rive state machine. Instead of animating every reaction, it blends modular pieces, and she ponders during processing delays instead of freezing. The file is under a megabyte. A good look at an AI interface that isn't a chat window.
  • Spotify Wrapped 2025: designers prototyped with dummy data, then engineers drove the same animations with each user's real data.
  • Strava Year in Sport: one data-bound file built personalized recaps for 5.87 million athletes in 14 languages.
  • Rive Marketplace: community files you can open and remix. The fastest way to see how someone else built a state machine.
  • Runtime demos: small working examples of the code side, from basic playback to data binding.

Your first build

Ask first: does this graphic need to react to something? If it plays the same way every time, a video or CSS animation is simpler.

If yes, pick a path:

  1. Remix, then wire. Open a Marketplace file in the editor, find its state machine and view model, export it, and load it with the code above.
  2. Have your agent build it. Install the Rive CLI (macOS on Apple Silicon, Linux or Windows), run rive create mascot, then rive mascot for the live preview. Open the folder in Claude Code and paste:
PROMPT / COPY-PASTE
Build a small mascot for my website in this Rive project. Work in stages and check with me after each: first a simple shape-based character, then three timelines (idle breathing, thinking, happy bounce), then a state machine that switches between them. Expose a view model with an enum "mood" (idle, thinking, happy) and a trigger "celebrate". Verify and screenshot after each stage. Then give me the minimal @rive-app/webgl2 code to load the .riv on a web page and set mood from JavaScript.

Either way, watch Rive's Quick Start tutorial first. Seeing a state machine built by hand makes everything above easier to steer.

Go deeper: State machines · Data binding · Canvas vs WebGL2 · Three.js: real-time 3D you build with code

Details checked against Rive's docs, pricing and the linked case studies on November 10, 2026.