Sourcemap Explorer
Stack · npm package

@lottiefiles/react-lottie-player

Lottie web player wrapper for React

latest 3.6.0· MIT· 61 versions publishedView on npm

About

Lottie web player wrapper for React

lottielottiefilesreact

What detecting @lottiefiles/react-lottie-player tells you about a site

@lottiefiles/react-lottie-player is LottieFiles' React wrapper around the Lottie runtime, so its presence is a double signal: the site ships designer-made vector animation, and the team is plugged into the LottieFiles platform and tooling rather than wiring lottie-web by hand. That usually marks a design-led product where motion is sourced from a shared animation library or marketplace, and it implies a Lottie runtime is bundled underneath the React component layer.

Why the exact @lottiefiles/react-lottie-player version matters

The LottieFiles player components have evolved alongside their newer dotLottie format and player web components, so the version indicates which player generation and which animation formats (classic Lottie JSON versus dotLottie) the integration supports, plus the React peer era. An older pin generally means the classic JSON-only path.

@lottiefiles/react-lottie-player in a real-world stack

When you find @lottiefiles/react-lottie-player in a bundle, it rarely travels alone. React and an underlying Lottie runtime; frequently next to LottieFiles-hosted assets.

Quick facts

Latest version3.6.0
LicenseMIT
AuthorJawish Hameed
Installnpm install @lottiefiles/react-lottie-player
Direct dependencies1
Peer dependenciesreact

Common pairings

Packages this one expects to find in the same project. Each is also a Sourcemap Explorer detection target.

What @lottiefiles/react-lottie-player pulls in

@lottiefiles/react-lottie-player declares 1 direct dependency — each one also rides into any bundle that ships @lottiefiles/react-lottie-player, so they are detection targets too. Reading them is a quick way to understand the package's real footprint .

How Sourcemap Explorer detects @lottiefiles/react-lottie-player

@lottiefiles/react-lottie-player ships as v3.6.0, published 2025-01-14 and carries 1 direct dependency, 1 peer dependency (react), 61 versions on the registry. Those exact numbers are the footprint Sourcemap Explorer matches when @lottiefiles/react-lottie-player rides inside a deployed bundle — here is how the detection works.

We catch @lottiefiles/react-lottie-player from two complementary signals: bundled source paths and the embedded package.json. Modern bundlers (webpack, Vite, esbuild, Rollup, Turbopack) preserve the original node_modules/@lottiefiles/react-lottie-player/ paths inside the JavaScript sourcemap's sources[] array — that's the canonical signal. When the matching package.json is also captured in sourcesContent[], we read the exact version field — patch number included. No regex guessing, no version inference.

  1. 1

    Confirm the site exposes sourcemaps

    In DevTools Network, check the response headers of any application script for `SourceMap` or `X-SourceMap`. Failing that, fetch the script's last 4 KB and look for a `//# sourceMappingURL=` comment — that map is where the `@lottiefiles/react-lottie-player` paths live.

  2. 2

    Find the package in the bundle

    Open DevTools → Network → reload. Click any application script and look at its sourcemap. Inside, search `sources[]` for entries matching `node_modules/@lottiefiles/react-lottie-player/` — every match confirms the package is bundled. The matching `sourcesContent[i]` for `node_modules/@lottiefiles/react-lottie-player/package.json` gives you the exact installed version.

  3. 3

    Read the version directly from package.json

    Run `jq -r '. as $m | $m.sources | to_entries[] | select(.value | endswith("node_modules/@lottiefiles/react-lottie-player/package.json")) | $m.sourcesContent[.key] | fromjson | .version' bundle.js.map`. Sourcemap Explorer automates the same query in the popup.

Major releases of @lottiefiles/react-lottie-player

When each major version first landed. Major bumps are where breaking changes live, so this timeline is the fastest way to date the @lottiefiles/react-lottie-player version a site actually ships against the ecosystem.

Major
First release
Date
v3
3.0.0
2021-01-22
v2
2.0.0
2020-07-14
v1
1.0.0
2020-05-19

Recent versions

Version
Released
3.6.0
2025-01-14
3.5.4
2024-05-24
3.5.3
2023-03-20
3.5.2
2023-01-25
3.5.1
2023-01-25
3.5.0
2022-12-07
3.4.9
2022-11-16
3.4.7
2022-05-13

@lottiefiles/react-lottie-player README

Live mirror of the GitHub README, for reference. Updated whenever the repo's default branch changes.

[!IMPORTANT] This package (@lottiefiles/react-lottie-player) is deprecated and no longer maintained. Please use @lottiefiles/dotlottie-react instead.


LottiePlayer React Component (Deprecated)

This is a React component for the Lottie Web Player

Demo

screencast

Documentation

In Javascript or TypeScript:
  1. Install package using npm or yarn.
npm install --save @lottiefiles/react-lottie-player
  1. Import package in your code.
import { Player, Controls } from '@lottiefiles/react-lottie-player';

Example/Development

  1. Clone repo

  2. run yarn install

  3. run yarn storybook

yarn storybook

Usage

Player component

Add the element Player and set the src prop to a URL pointing to a valid Lottie JSON.

<Player
  autoplay
  loop
  src="https://assets3.lottiefiles.com/packages/lf20_UJNc2t.json"
  style={{ height: '300px', width: '300px' }}
>
  <Controls visible={true} buttons={['play', 'repeat', 'frame', 'debug']} />
</Player>

Props

PropDescriptionTypeDefault
lottieRefGet lottie animation objectfunctionundefined
onEventListen for eventsfunctionundefined
onStateChangePlay state changesfunctionundefined
onBackgroundChangeListen for bg changesfunctionundefined
autoplayAutoplay animation on load.booleanfalse
backgroundBackground color.stringundefined
controlsShow controls.booleanfalse
directionDirection of animation.number1
hoverWhether to play on mouse hover.booleanfalse
keepLastFrameStop animation on the last frame.
Has no effect if loop is true.
booleanfalse
loopWhether to loop animation.booleanfalse
rendererRenderer to use.`"svg""canvas"`
speedAnimation speed.number1
styleThe style for the container.objectundefined
src (required)Bodymovin JSON data or URL to JSON.objectstring

Get Player instance

To call methods on the instance of the Player component. you may get a reference to the component and call the methods on ref.current. This is esentially reacts way of doing a document.getElementById(); You may then use this ref ie: player in the example below to call methods that are described in this documentation. See ref in react documentation

import React from 'react';
import { Player } from '@lottiefiles/react-lottie-player';

class App extends React.Component {
  constructor(props) {
    super(props);
    this.player = React.createRef(); // initialize your ref
  }
  render() {
    return (
      <Player
        ref={this.player} // set the ref to your class instance
        autoplay={false}
        loop={true}
        controls={true}
        src="https://assets3.lottiefiles.com/packages/lf20_XZ3pkn.json"
        style={{ height: '300px', width: '300px' }}
      ></Player>
    );
  }
}

export default App;

Get Lottie instance

The lottieRef prop returns the Lottie instance which you can use to set data and call methods as described in the bodymovin documentation.

import React from 'react';
import { Player } from '@lottiefiles/react-lottie-player';

class App extends React.Component {
  constructor(props) {
    super(props);
    this.state = { lottie: null }; // initialize your state
  }

  render() {
    return (
      <Player
        lottieRef={instance => {
          this.setState({ lottie: instance }); // the lottie instance is returned in the argument of this prop. set it to your local state
        }}
        autoplay={false}
        loop={true}
        controls={true}
        src="https://assets3.lottiefiles.com/packages/lf20_XZ3pkn.json"
        style={{ height: '300px', width: '300px' }}
      ></Player>
    );
  }
}

export default App;

Listening for events

import React from 'react';
import { Player } from '@lottiefiles/react-lottie-player';

class App extends React.Component {
  constructor(props) {
    super(props);
    this.player = React.createRef();
  }

  doSomething() {
    this.player.current.play(); // make use of the player and call methods
  }

  render() {
    return (
      <Player
        onEvent={event => {
          if (event === 'load') this.doSomething(); // check event type and do something
        }}
        ref={this.player}
        autoplay={false}
        loop={true}
        controls={true}
        src="https://assets3.lottiefiles.com/packages/lf20_XZ3pkn.json"
        style={{ height: '300px', width: '300px' }}
      ></Player>
    );
  }
}

export default App;

Events

The following events are exposed and can be listened to via addEventListener calls.

NameDescription
loadAnimation data is loaded.
errorAn animation source cannot be parsed, fails to load or has format errors.
readyAnimation data is loaded and player is ready.
playAnimation starts playing.
pauseAnimation is paused.
stopAnimation is stopped.
freezeAnimation is paused due to player being invisible.
loopAn animation loop is completed.
completeAnimation is complete (all loops completed).
frameA new frame is entered.

Methods

pause() => void

Pause animation play.

Returns

Type: void

play() => void

Start playing animation.

Returns

Type: void

setPlayerDirection(direction: 1 | -1 ) => void

Animation play direction.

Parameters
NameTypeDescription
valuenumberDirection values.
Returns

Type: void

setPlayerSpeed(speed?: number) => void

Sets animation play speed.

Parameters
NameTypeDescription
valuenumberPlayback speed.
Returns

Type: void

stop() => void

Stops animation play.

Returns

Type: void

setSeeker(frame: number, play: boolean) => void

Seek to a given frame.

Returns

Type: void

Contributing

We use changesets to maintain a changelog for this repository. When making any change to the codebase that impacts functionality or performance we require a changeset to be present.

To add a changeset run:

yarn run changeset

And select the type of version bump you'd like (major, minor, path).

You can document the change in detail and format it properly using Markdown by opening the ".md" file that the "yarn changeset" command created in the ".changeset" folder. Open the file, it should look something like this:

---
"@lottiefiles/pkg1": minor
"@lottiefiles/pkg2": major
---

This is where you document your **changes** using Markdown.

- You can write
- However you'd like
- In as much detail as you'd like

Aim to provide enough details so that team mates and future you can understand the changes and the context of the change.

You can commit your changes and the changeset to your branch and then create a pull request on the develop branch.

License

MIT License © LottieFiles.com

FAQ

What is @lottiefiles/react-lottie-player used for?

Lottie web player wrapper for React

How can I tell if a website is using @lottiefiles/react-lottie-player?

Open the page in Chrome with the Sourcemap Explorer extension installed and read the Stack tab. We catch `@lottiefiles/react-lottie-player` from two complementary signals: `node_modules/@lottiefiles/react-lottie-player/` paths inside the JavaScript sourcemap, and the embedded `package.json` we read for exact-version detection. Without the extension you can do the same lookup manually in DevTools — the steps are listed in the "How Sourcemap Explorer detects" section above.

How do I find out which version of @lottiefiles/react-lottie-player a website is running?

Read it straight from the site's JavaScript sourcemap. When a build ships source maps, the bundled `@lottiefiles/react-lottie-player/package.json` carries the exact `version` string — Sourcemap Explorer extracts it in one click on the Stack tab, and you can do it by hand in DevTools by opening the `.map` file and searching for `node_modules/@lottiefiles/react-lottie-player/package.json`. That is far more reliable than inferring the version from an asset-hash or a `?ver=` query string, which is all surface-level detectors have to go on. The current npm release is 3.6.0, but real deployments frequently run an older pinned version — which is exactly why reading the bundled number matters.

What is the latest version of @lottiefiles/react-lottie-player?

3.6.0, as published on the npm registry. The "Recent versions" table on this page lists the most recent 8 releases with their release dates. Sourcemap Explorer reports the version actually bundled into a site, which can lag the latest release by months on real-world deployments.

Is @lottiefiles/react-lottie-player actively maintained?

Maintained but slow-moving — releases come every several months rather than weekly. The last published release was 2025-01-14. Source code: https://github.com/LottieFiles/lottie-react.

Where can I read more?

Project homepage: https://github.com/LottieFiles/lottie-react#readme. Source code: https://github.com/LottieFiles/lottie-react. Published on npm: https://www.npmjs.com/package/@lottiefiles/react-lottie-player. Licensed as MIT.

Keep reading on Sourcemap Explorer

Detected by Sourcemap Explorer

When a bundle ships sourcemaps, we read the embedded package.json for @lottiefiles/react-lottie-player and report the precise version (the registry's latest is v3.6.0, published 2025-01-14; the bundled copy is often older). Without sourcemaps, an import / require in the page's scripts is enough to flag it.

Install free on Chrome