Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-lottie

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-lottie

Lottie wrapper for React Native. (Android/iOS/Web)

  • 0.0.1-alpha.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
17
decreased by-26.09%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-lottie

This is a simple wrapper around lottie-react-native for Android and iOS runtimes, and react-native-web-lottie on the Web.

This project saves you from having to tinker with webpack, which is great if you're not ready to expo eject.

🚀 Installing

Using yarn on react-native init:

yarn add react-native-lottie lottie-react-native

Using yarn on create-react-native-app:

yarn add react-native-lottie ; expo install lottie-react-native

💭 Usage

import React, { useState, useEffect } from "react";
import Animation from "react-native-lottie";
import { Animated, Platform, StyleSheet } from "react-native";

import SomeLottieAnimation from "./assets/some-lottie-animation.json";

const styles = StyleSheet.create({
  anim: { width: 200, height: 200, backgroundColor: "green" },
});

export default () => {
  const [progress] = useState(() => new Animated.Value(0));
  useEffect(
    () => {
      Animated.timing(
        progress,
        { toValue: 1, duration: 1000, useNativeDriver: Platform.OS !== "web" },
      ).start();
    },
    [progress],
  );
  return (
    <Animation
      style={styles.anim}
      source={SomeLottieAnimation}
      progress={progress}
    />
  );
};

✌️ License

MIT

Keywords

FAQs

Package last updated on 20 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc