rive-react

Trigger when: (1) Using @rive-app/react-canvas or @rive-app/react-webgl, (2) Using useRive hook or RiveComponent, (3) Building React components with Rive animations, (4) User mentions "Rive React" or "useRive", (5) Implementing scroll-based or parallax animations with Rive. Best practices for integrating Rive animations in React applications using the official Rive React package. Covers hooks, layout, and scroll animations.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "rive-react" with this command: npx skills add stevysmith/rive-skills/stevysmith-rive-skills-rive-react

Rive React

React components and hooks for Rive animations.

Installation

# Canvas renderer (recommended)
npm install @rive-app/react-canvas

# WebGL renderer (complex animations)
npm install @rive-app/react-webgl

Quick Start

import { useRive } from '@rive-app/react-canvas';

function MyAnimation() {
  const { RiveComponent } = useRive({
    src: 'animation.riv',
    stateMachines: 'State Machine 1',
    autoplay: true,
  });

  return <RiveComponent />;
}

useRive Hook

The main hook for Rive integration:

const {
  RiveComponent,    // The canvas component to render
  rive,            // Rive instance for direct control
} = useRive({
  src: 'animation.riv',
  stateMachines: 'State Machine',
  autoplay: true,
});

Controlling Inputs

import { useRive, useStateMachineInput } from '@rive-app/react-canvas';

function ControlledAnimation() {
  const { rive, RiveComponent } = useRive({
    src: 'animation.riv',
    stateMachines: 'State Machine',
    autoplay: true,
  });

  // Get typed input
  const isActive = useStateMachineInput(rive, 'State Machine', 'isActive');
  const progress = useStateMachineInput(rive, 'State Machine', 'progress');

  return (
    <>
      <RiveComponent />
      <button onClick={() => isActive && (isActive.value = !isActive.value)}>
        Toggle
      </button>
      <input
        type="range"
        onChange={(e) => progress && (progress.value = +e.target.value)}
      />
    </>
  );
}

Callbacks

const { RiveComponent } = useRive({
  src: 'animation.riv',
  stateMachines: 'State Machine',
  autoplay: true,
  onLoad: () => console.log('Loaded'),
  onStateChange: (event) => console.log('State:', event.data),
  onPlay: () => console.log('Playing'),
  onPause: () => console.log('Paused'),
});

Rules

@file rules/use-rive.md @file rules/callbacks.md @file rules/layout.md @file rules/scroll-animations.md

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

Telegram Mini App Dev

Build Telegram Mini Apps without the pain. Includes solutions for safe areas, fullscreen mode, BackButton handlers, sharing with inline mode, position:fixed issues, and React gotchas. Use when building or debugging Telegram Mini Apps, or when encountering issues with WebApp API, safe areas, or sharing.

Registry SourceRecently Updated
1.9K1Profile unavailable
General

Shadcn/Ui Complete Documentation

Complete shadcn/ui documentation. Beautifully designed components built with Radix UI and Tailwind CSS. Copy-paste into your apps. Covers installation, components, theming, forms, charts, and framework integrations.

Registry SourceRecently Updated
1.2K1Profile unavailable
General

rive

No summary provided by upstream source.

Repository SourceNeeds Review
General

rive-scripting

No summary provided by upstream source.

Repository SourceNeeds Review