Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A lightweight React library for rendering complex After Effects animations in real time using Lottie.

License

NotificationsYou must be signed in to change notification settings

Gamote/lottie-react

Repository files navigation

npm versionnpm downloads/monthKnown VulnerabilitiesCoverage StatusTested with jestGitHub license

This project is meant to give developers full control overLottie instance with minimal implementation by wrappinglottie-web in a Component or Hook that can be easily used inReact applications.

Installation

  1. Make sure you have the peer-dependencies installed:react andreact-dom.

    Note: This library is using React Hooks so theminimum version required for bothreact andreact-dom isv16.8.0.

  2. Installlottie-react usingyarn

    yarn add lottie-react

    ornpm

    npm i lottie-react

Usage

Using the component (try it)

importReactfrom"react";importLottiefrom"lottie-react";importgroovyWalkAnimationfrom"./groovyWalk.json";constApp=()=><LottieanimationData={groovyWalkAnimation}loop={true}/>;exportdefaultApp;

Using the Hook (try it)

importReactfrom"react";import{useLottie}from"lottie-react";importgroovyWalkAnimationfrom"./groovyWalk.json";constApp=()=>{constoptions={animationData:groovyWalkAnimation,loop:true};const{ View}=useLottie(options);return<>{View}</>;};exportdefaultApp;

📄 Documentation

Checkout thedocumentation athttps://lottiereact.com for more information and examples.

Tests

Run the tests using theyarn test command.

Coverage report

-----------------------------|---------|----------|---------|---------|-------------------File                         | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s -----------------------------|---------|----------|---------|---------|-------------------All files                    |     100 |      100 |     100 |     100 |                    components                  |     100 |      100 |     100 |     100 |                     Lottie.ts                  |     100 |      100 |     100 |     100 |                    hooks                       |     100 |      100 |     100 |     100 |                     useLottie.tsx              |     100 |      100 |     100 |     100 |                     useLottieInteractivity.tsx |     100 |      100 |     100 |     100 |                   -----------------------------|---------|----------|---------|---------|-------------------

Contribution

Anyquestions orsuggestions? Use theDiscussions tab. Anyissues? Don't hesitate to document it in theIssues tab, and we will do our best to investigate it and fix it. Anysolutions? You are very welcomed to open apull request.

👩‍💻v3 is under development and is planning to bring a lot of features and improvements. But unfortunately, at the moment all the maintainers are super busy with work related projects. You can check out the progress under thev3 branch. And of course, you are encouraged to contribute. :)

Thank you for investing your time in contributing to our project! ✨

Projects to check out

  • lottie-web - Lottie implementation for Web. Our project is based on it, and you might want to check it out in order to have a better understanding on what's behind this package or what features could you expect to have in the future.
  • lottie-android - Lottie implementation for Android
  • lottie-ios - Lottie implementation for iOS
  • lottie-react-native - Lottie implementation for React Native
  • LottieFiles - Are you looking for animations files? LottieFiles has a lot of them!

License

lottie-react is available under theMIT license.

Thanks toDavid Probst Jr for the animations used in the examples.

About

A lightweight React library for rendering complex After Effects animations in real time using Lottie.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Sponsor this project

 

Contributors9


[8]ページ先頭

©2009-2026 Movatter.jp