Rive
~146kb minifiedInteractive vector animations with state machines.
See It in Action
Every demo loads a self-hosted v7 .riv file into a canvas. The third demo shows runtime introspection -- listing every artboard, animation, and state machine the designer baked into the file.
Load a .riv file into a canvas and autoplay it. The simplest Rive pattern -- identical in shape to a Lottie load.
What is Rive?
Rive is a runtime for designer-authored interactive vector animations. A designer builds the animation -- and its state machine, inputs, and transitions -- in the Rive editor, exports it as a single .riv binary, and you load it at runtime into a <canvas>. The big difference from Lottie: Rive files respond to runtime inputs.
Instead of just playing back frames, you flip a boolean input (Hovered), pass a pointer position (Axis_X, Axis_Y), or fire a trigger (Clicked), and the Rive runtime blends between the states the designer authored. That turns vector animations from decorations into actual UI components.
When to Use Rive
How Rive Compares
Lottie plays a fixed JSON file -- no interactivity. Rive files respond to runtime inputs and state changes. Use Lottie when the designer's animation is the whole thing; use Rive when the animation needs to react to the user or your app state.
GSAP animates DOM, SVG, and canvas from code -- any property, any timing. Rive plays designer-authored state machines. They're complementary: GSAP animates the page chrome, Rive plays the complex illustration inside it.
Framer Motion is a code-authored React animation library. Rive is a designer-authored vector animation runtime. If your team's animations live in code with React components, use Framer Motion. If a designer authors complex scenes in a visual tool, use Rive.
Get Started with Rive
npm install @rive-app/canvas
yarn add @rive-app/canvas
<script src="https://cdn.jsdelivr.net/npm/@rive-app/[email protected]/rive.min.js"></script>
<canvas id="rive-canvas" width="400" height="400"></canvas>
<script src="https://cdn.jsdelivr.net/npm/@rive-app/[email protected]/rive.min.js"></script>
<script>
const r = new rive.Rive({
src: "https://example.com/your-animation.riv",
canvas: document.getElementById("rive-canvas"),
autoplay: true,
// If the file has a state machine, name it here to enable runtime inputs
stateMachines: "State Machine 1",
onLoad: function () {
// Match the canvas drawing surface to its CSS size so it renders crisp
r.resizeDrawingSurfaceToCanvas();
// Flip a boolean input to drive a state transition
const inputs = r.stateMachineInputs("State Machine 1");
const hovered = inputs && inputs.find(function (i) { return i.name === "Hovered"; });
if (hovered) hovered.value = true;
}
});
</script>