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

@aarsteinmedia/dotlottie-react

v1.0.0

Published

React component for playing Lottie animations in your React web app.

Downloads

167

Readme

AM LottiePlayer React

Awesome Vector Animations

This is a reworked verson of @aarsteinmedia/dotlottie-player – with the same functionality, but made to work natively with React.

Installation

pnpm add @aarsteinmedia/dotlottie-react

Usage

Import the component and use it in your markup, like any other React component.

import DotLottiePlayer '@aarsteinmedia/dotlottie-react'

export default function App() {
  return (
    <DotLottiePlayer
      className="your-class-name"
      src="https://storage.googleapis.com/aarsteinmedia/am.lottie"
      autoplay
      controls
      loop
      style={{
        width: '320px',
        margin: 'auto'
      }}
    />
  )
}

With TypeScript and ref

If you're using TypeScript and ref you can do something like this:

import { useRef } from 'react'

import DotLottiePlayer, { type DotLottieMethods } '@aarsteinmedia/dotlottie-react'

export default function App() {
  const animation = useRef<DotLottieMethods>(null)

  return (
    <DotLottiePlayer
      src="https://storage.googleapis.com/aarsteinmedia/am.lottie"
      ref={animation}
      onMouseEnter={() => animation.current?.play()}
      onMouseLeave={() => animation.current?.stop()}
    />
  )
}

Attributes

| Attribute | Description | Type | Default | | ------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- | ----------------- | | animateOnScroll | Play animation by scrolling | boolean | false | | autoplay | Play animation on load | boolean | false | | background | Background color | string | undefined | | controls | Show controls | boolean | false | | count | Number of times to loop animation | number | undefined | | direction | Direction of animation | 1 | -1 | 1 | | hover | Whether to play on mouse hover | boolean | false | | loop | Whether to loop animation | boolean | false | | mode | Play mode | normal | bounce | normal | | objectFit | Resizing of animation in container | contain | cover | fill | none | contain | | renderer | Renderer to use | svg | canvas | html | svg | | speed | Animation speed | number | 1 | | src | URL to LottieJSON or dotLottie | string | undefined | | subframe | When enabled this can help to reduce flicker on some animations, especially on Safari and iOS devices. | boolean | false |

Methods

The following methods are exposed via useRef hook.

| Method | Function | --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | | addAnimation(params: AddAnimationParams) => Promise<Result> | Add animation. Triggers download of new dotLottie file. | | convert(params: ConvertParams) => Promise<Result> | If the current animation is in JSON format – convert it to dotLottie. Triggers a download in the browser. | | load(src: string \| null) => Promise<void> | Load animation by URL or JSON object | | next() => void | Next animation (if several in file) | | pause() => void | Pause | | play() => void | Play | | previous() => void | Previous animation (if several in file) | | seek(value: number \| string) => void | Go to frame. Can be a number or a percentage string (e. g. 50%). | | setCount(value: number) => void | Dynamically set number of loops | | setDirection(value: AnimationDirection) => void | Set Direction | | setLoop(value: boolean) => void | Set Looping | | setMultiAnimationSettings(value: AnimationSettings[]) => void | Set Multi-animation settings | | setSegment(value: AnimationSegment) => void | Play only part of an animation. E. g. from frame 10 to frame 60 would be [10, 60] | | setSpeed(value: number) => void | Set Speed | | setSubframe(value: boolean) => void | Set subframe | | stop() => void | Stop |

License

GPL-2.0-or-later