Gamote/lottie-react

Lottie animations in React: one component for the easy path, the whole engine when you need control.

TypeScript

969

53 commits

updated Sep 7, 2026

See the code

README

lottie-react

lottie-react

Lottie animations in React: one component for the easy path, the whole engine when you need control.

npm version npm downloads build status coverage license

Installation

npm i lottie-react

react and react-dom at 18.2 or newer are peer dependencies; lottie-web comes with it. The package is tree-shakeable: an import pays only for what it reaches.

Usage

The component

import { Lottie } from "lottie-react";

export function Hero() {
  return <Lottie src="/hero.json" autoplay loop />;
}

src takes a path, a URL, or the parsed animation object. The animation fills its element, so size the element and you are done.

The hook

import { useLottie } from "lottie-react";

export function Hero() {
  const lottie = useLottie({ src: "/hero.json", autoplay: true, loop: true });
  return <div ref={lottie.setDisplayRef} style={{ height: 300 }} />;
}

The hook returns the instance: values that re-render with the animation, commands like play and seek, and a subscription point.

Documentation

Guides, live examples and the full API reference: lottiereact.com.

Coming from v2? The migration guide maps every v2 surface onto v3.

Contributing

Issues and pull requests are welcome. CONTRIBUTING.md carries the setup and the checks.

License

MIT

after-effects
animation
lottie
lottie-react
lottie-web
react
react-component
react-hooks
typescript

Gamote/lottie-react

Lottie animations in React: one component for the easy path, the whole engine when you need control.

TypeScript

969

53 commits

updated Sep 7, 2026

See the code

README

lottie-react

lottie-react

Lottie animations in React: one component for the easy path, the whole engine when you need control.

npm version npm downloads build status coverage license

Installation

npm i lottie-react

react and react-dom at 18.2 or newer are peer dependencies; lottie-web comes with it. The package is tree-shakeable: an import pays only for what it reaches.

Usage

The component

import { Lottie } from "lottie-react";

export function Hero() {
  return <Lottie src="/hero.json" autoplay loop />;
}

src takes a path, a URL, or the parsed animation object. The animation fills its element, so size the element and you are done.

The hook

import { useLottie } from "lottie-react";

export function Hero() {
  const lottie = useLottie({ src: "/hero.json", autoplay: true, loop: true });
  return <div ref={lottie.setDisplayRef} style={{ height: 300 }} />;
}

The hook returns the instance: values that re-render with the animation, commands like play and seek, and a subscription point.

Documentation

Guides, live examples and the full API reference: lottiereact.com.

Coming from v2? The migration guide maps every v2 surface onto v3.

Contributing

Issues and pull requests are welcome. CONTRIBUTING.md carries the setup and the checks.

License

MIT

after-effects
animation
lottie
lottie-react
lottie-web
react
react-component
react-hooks
typescript

Project health

Overall

4.9/10

Maintained

10/10

Code review

0/10
OpenSSF Scorecard

Latest release

3.1.2 · Sep 7, 2026

Releases this year

5

Significant stargazers

Bruno Lemos

1,185 followers · starred Feb 2025

lijianan

2,020 followers · starred Dec 2025

Matthew Rumery

21 followers · starred Dec 2021

Dominic Lee

16 followers · starred Aug 2022