npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nuxt-rive

v1.2.2

Published

Nuxt Rive module

Readme

nuxt-rive

Nuxt-Rive

npm version npm downloads License Nuxt

Integrate Rive into your Nuxt application.

This library allows full control over Rive files with a high-level API for hooking up many simple interactions and animations, as well as a low-level API that allows you to drive your own render loop to create multiple artboards, animations, and state machines all in one canvas.

Release Notes ▶️ Online playground 📖 Documentation

Quick Setup

  1. Add nuxt-rive dependency to your project
# Using pnpm
pnpm add -D nuxt-rive

# Using yarn
yarn add --dev nuxt-rive

# Using npm
npm install --save-dev nuxt-rive
  1. Add nuxt-rive to the modules section of nuxt.config.ts
export default defineNuxtConfig({
  modules: [
    'nuxt-rive'
  ]
})

Basic Usage

Use the <NuxtRive> component to render your animations:

<template>
  <ClientOnly>
    <NuxtRive
      :rive-params="{
        src: 'https://cdn.rive.app/animations/vehicles.riv',
        autoplay: true,
        stateMachines: 'bumpy',
        artboard: 'Truck'
      }"
      :options="{
        fitCanvasToArtboardHeight: true,
        useOffscreenRenderer: true
      }"
    />
  </ClientOnly>
</template>

Features

  • Component-Based: Easy-to-use <NuxtRive> component.
  • SSR Compatible: Works seamlessly with Nuxt (use <ClientOnly> wrapper).
  • Interactive: Full control via useRiveStateMachineInput.
  • Dynamic Text: Update text runs at runtime with the text-runs prop.
  • Events: Listen to Rive events like Play, Pause, Stop, Loop, and StateChange.
  • Efficient: Uses @rive-app/webgl for high-performance rendering.
  • Nuxt DevTools: Integrated DevTools tab to view and manage your Rive assets.

Nuxt DevTools Integration

nuxt-rive comes with a custom tab for Nuxt DevTools that allows you to:

  • Explore all Rive assets in your project (public and assets directories).
  • Preview animations directly within the DevTools.
  • Inspect file details like size and path.
  • Copy usage snippets for quick integration into your components.

To use it, simply open Nuxt DevTools in your development environment and click on the Nuxt Rive tab.

Component Props

| Prop | Type | Description | | --- | --- | --- | | rive-params | UseRiveParameters | Configuration object for the Rive instance (src, artboard, stateMachines, etc.). | | options | UseRiveOptions | Runtime options like fitCanvasToArtboardHeight and useOffscreenRenderer. | | text-runs | Record<string, string> | (New) Replaces text run values dynamically. Key is the run name, value is the new text. |

rive-params Interface

interface UseRiveParameters {
  src?: string;
  artboard?: string;
  animations?: string | string[];
  stateMachines?: string | string[];
  layout?: Layout;
  autoplay?: boolean;
  // ...and more standard Rive parameters
}

Events

The <NuxtRive> component emits the following events:

  • @rive-is-loaded: Triggered when the Rive instance is fully loaded. Returns the Rive instance.
  • @play: Triggered when an animation starts playing.
  • @pause: Triggered when an animation is paused.
  • @stop: Triggered when an animation stops.
  • @loop: Triggered when an animation loops.
  • @statechange: Triggered when a state machine changes state.

Composables

useRiveStateMachineInput

Helper composable to control State Machine inputs (Triggers, Booleans, Numbers).

const { RiveInstance } = await useRive() // or get instance from @rive-is-loaded

// Trigger an input
useRiveStateMachineInput(RiveInstance, 'StateMachineName', 'InputName').fire()

// Set a boolean
const boolInput = useRiveStateMachineInput(RiveInstance, 'StateMachineName', 'BooleanInput')
boolInput.value = true

// Set a number
const numInput = useRiveStateMachineInput(RiveInstance, 'StateMachineName', 'NumberInput')
numInput.value = 50

Dynamic Text Example

<template>
  <NuxtRive
    :rive-params="{ src: 'my-file.riv' }"
    :text-runs="{
      'MyTextRun': 'Dynamic Value',
      'Score': '100'
    }"
  />
</template>

Contributing

  1. Install dependencies with pnpm.
  2. Run pnpm dev:prepare to generate stubbed dist directory.
  3. Make your changes.
  4. Run pnpm lint to verify that there is no issues (consider adding tests).
  5. Submit a PR.

License

This repository is licensed under the MIT License. Feel free to use the code and modify it according to your needs.