All Projects → colmbrady → lottie-reactxp

colmbrady / lottie-reactxp

Licence: MIT license
Basic wrapper around Lottie for ReactXP.

Programming Languages

javascript
184084 projects - #8 most used programming language
objective c
16641 projects - #2 most used programming language
python
139335 projects - #7 most used programming language
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to lottie-reactxp

Nativescript Lottie
NativeScript plugin to expose Airbnb Lottie
Stars: ✭ 149 (+365.63%)
Mutual labels:  lottie
ViewPagerSlidingLottie
Animate LottieAnimationView with a viewpager
Stars: ✭ 30 (-6.25%)
Mutual labels:  lottie
DailyFeed
iOS client for newsapi.org
Stars: ✭ 128 (+300%)
Mutual labels:  lottie
Android Collectiondemo
集合了多个框架编译的demo,GreenDao数据库、网络访问、recyclerview、Lottie动画等
Stars: ✭ 166 (+418.75%)
Mutual labels:  lottie
Flopsy
A cute little bunny animation that responds to text field interactions.
Stars: ✭ 242 (+656.25%)
Mutual labels:  lottie
lottie-idea
Android Studio and IntelliJ IDEA viewer plugin for Lottie animations
Stars: ✭ 36 (+12.5%)
Mutual labels:  lottie
Motionlayoutsamples
A sample to take you to appreciate the charm of MotionLayout.
Stars: ✭ 135 (+321.88%)
Mutual labels:  lottie
svelte-lottie-player
Lottie Player component for Svelte
Stars: ✭ 90 (+181.25%)
Mutual labels:  lottie
react-native-animated-loader
🍭 A React Native Loader Component which uses Airbnb's Lottie for beautiful loader animations.
Stars: ✭ 165 (+415.63%)
Mutual labels:  lottie
RavEngine
A fast, easy to use C++20 3D game library for modern computers
Stars: ✭ 122 (+281.25%)
Mutual labels:  lottie
Ae Element
🎨 use bodymovin to render some interesting After Effects vector element
Stars: ✭ 180 (+462.5%)
Mutual labels:  lottie
Puppeteer Lottie
Renders Lottie animations via Puppeteer to image, GIF, or MP4.
Stars: ✭ 208 (+550%)
Mutual labels:  lottie
reactxp-map
Plugin for ReactXP that provides support for Google Maps for Web, Android and iOS
Stars: ✭ 13 (-59.37%)
Mutual labels:  reactxp
Lottie Flutter
Stars: ✭ 160 (+400%)
Mutual labels:  lottie
Compose-ToDo
A fully functional Android TODO app built entirely with Kotlin and Jetpack Compose
Stars: ✭ 130 (+306.25%)
Mutual labels:  lottie
Tgs To Gif
Converts animated Telegram stickers (*.tgs) to animated GIFs (.gif)
Stars: ✭ 148 (+362.5%)
Mutual labels:  lottie
AE-Icon
🐱 use bodymovin to render some interesting After Effects vector icon
Stars: ✭ 47 (+46.88%)
Mutual labels:  lottie
Animation
Android各种动画效果合集,项目包含了丰富的动画实例(逐帧动画,补间动画,Lottie动画,GIF动画,SVGA动画),体验动画之美,让Android动起来😄😄😄
Stars: ✭ 268 (+737.5%)
Mutual labels:  lottie
CarLens-iOS
CarLens - Recognize and Collect Cars
Stars: ✭ 124 (+287.5%)
Mutual labels:  lottie
photoeditor
👨🏻‍🎨 ReactJS Photo Editor
Stars: ✭ 26 (-18.75%)
Mutual labels:  lottie

Lottie React

Build Status

Exposes Lottie as a ReactXP extension.

Lottie is an iOS, Android, and React Native library that renders After Effects animations in real time, allowing apps to use animations as easily as they use static images. There is also a variant that works in a browser.

The reason for creating this etension is because the existing SVG ReactXP extension provided by Microsft does not implement the complete set of SVG elements. Lottie avoids having to deal directly with SVG.

Getting Started (Development)

Its a prequisite to set up React Native if you intend on running the Lottie examples on IOS or Andoid. Install React Native CLI by following this guide. Follow the "Building Projects from Native Code" tab.

For development, lets start by installing the NPM dependencies and peer dependencies.

npm run dev:setup # run from the checkout location

The example Lottie components can be viewed using a Storybook. Storybook is a demo playground for React components.

If using the bundled Storybook - the Lottie RN Setup has already been done.

Finally, run the Storybook on either Web:

npm run storybook-web

and/or Native:

npm run storybook-native
npm run dev:ios
npm run dev:android

npm run build can be used to rebuild the source code.

Getting Started (Usage)

Npm install module from GitHub:

npm i lottie-reactxp --save

Next follow the Lottie RN Setup. Note, you can skip installing the lottie-react-native NPM module as it's a dependency of this module. You will still have to do the react native linking steps however.

You will also need to have your required peer dependencies. The recommended peer dependencies are:

  • "react-native-windows": ">= 0.33.0"
  • "react-native": ">= 0.51.0"
  • "react-dom": ">= 16.0.0"
  • "react": ">= 16.0.0"
  • "reactxp": ">= 0.46.3"

You should be able to use in your code:

import RX from 'reactxp';
import Lottie from 'lottie-reactxp';
import lottieData from './lottie-data.json';
...
render() {
    // state can be used to control the animation
    const { isStopped, duration } = this.state;
    return (
      <RX.View>
        <Lottie
          source={lottieData}
          isStopped={isStopped}
          height={400}
          width={400}
          duration={Number(duration)}
          onLoopComplete={() => { console.log('onLoopComplete'); }}
          onComplete={() => { console.log('onComplete'); }}
        />
      </RX.View>
    );
}

Available props:

Name Description Type Required Default
source The Lottie data as a JSON file object Yes -
loop Whether the animaiton will repeat indefinitly bool No true
isStopped True will stop animation, false will continue animation. bool No false
duration Amount of seconds to run animation for. Setting the duration to the same amount as the Lottie animation length will result in a "speed" of 1 being set on the Lottie renderer. number No 1
width Sets the px width of the container surrounding animation number No undefined
height Sets the px height of the container surrounding animation number No undefined
style passes style information down to the underlying Lottie control object No {}
onComplete callback triggered when an animation has finished and loop is false. func No () => {}
onLoopComplete callback triggered when an animation has finished and loop is true. func No () => {}

Found a bug?

Please raise an issue if you have problems.

Contributing

Im open to contributions and improvements. Please raise an issue to discuss.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].