New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-native-animated-loader

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-animated-loader

react-native-animated-loader

  • 0.0.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
227
decreased by-79.21%
Maintainers
1
Weekly downloads
 
Created
Source

React Native Animated Loader

downloads npm-version github-tag license

A React Native Loader Component which uses Airbnb's Lottie for beautiful loader animations.

     

Prerequisites

This library uses lottie-react-native to render loader animations. Therefor this library need to be installed and linked to your project before installing this package.

Follow the official instruction and linking guide here.

Install

yarn add react-native-animated-loader

or

npm install react-native-animated-loader --save

Usage

import React from 'react';
import { StyleSheet } from 'react-native';
import AnimatedLoader from "react-native-animated-loader";

export default class Loader extends React.Component {
  constructor(props) {
    super(props);
    this.state = { visible: false };
  }

  componentDidMount() {
    setInterval(() => {
      this.setState({
        visible: !this.state.visible
      });
    }, 30000);
  }

  render() {
    const { visible } = this.state;
    return (
      <AnimatedLoader
        visible={visible}
        overlayColor="rgba(255,255,255,0.75)"
        source={require("./loader.json")}
        animationStyle={styles.lottie}
        speed={1}
      />
    );
  }
}

const styles = StyleSheet.create({
  lottie: {
    width: 100,
    height: 100
  }
});

Props

PropDescriptionDefault
sourceThe source of animation. Can be referenced as a local asset by a string, or remotely with an object with a uri property, or it can be an actual JS object of an animation, obtained (for example) with something like require('../path/to/animation.json').Lottie Object
visibleControls the visibility of the loader.false
overlayColorChanges the color of the overlay.rgba(255,255,255,0.75)
animationStyleThe style to be applied to the Lottie.-
animationTypeChanges animation on show and hide loader's view.none
speedThe speed the animation will progress.1
loopA boolean flag indicating whether or not the animation should loop.true

TODOs

  • Add expo example
  • Add ability to render text with animations
  • Add test cases

License

Licensed under the MIT.

Keywords

FAQs

Package last updated on 14 Feb 2019

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