GithubHelp home page GithubHelp logo

admajora / react-native-bouncing-preloader Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sonnylazuardi/react-native-bouncing-preloader

0.0 1.0 0.0 2.52 MB

⛹️‍♂️ Bouncing preloader component with custom icons in React Native

Home Page: https://expo.io/@sonnylazuardi/react-native-bouncing-preloader

License: MIT License

JavaScript 100.00%

react-native-bouncing-preloader's Introduction

React Native Bouncing Preloader

Bouncing Preloader Component with custom icons in React Native

icon

demo

Based on the dribbble shot by Dany Rizky: https://dribbble.com/shots/4423936-Islands-Preloader-Animation

dribbbleshot

Demo

https://exp.host/@sonnylazuardi/react-native-bouncing-preloader

Background

When I saw the preloader animation, I think it would be great if we can use our own icon and give more control to the bouncing animation and rotation. So I tried to make this open source component.

Goals

  • Animate our own custom icon
  • Flexible to use remote image url or local image file
  • Able to control distance, rotation angle etc

Usage

  • npm install --save react-native-bouncing-preloader
  • In your react native script add these lines
import BouncingPreloader from 'react-native-bouncing-preloader';

<BouncingPreloader
  icons={[
    'https://www.shareicon.net/data/256x256/2016/05/04/759946_bar_512x512.png',
    require('./assets/image.png'),
  ]}
  leftRotation="-680deg",
  rightRotation="360deg",
  leftDistance={-180},
  rightDistance={-250},
  speed={1200} />

// or just give icons

<BouncingPreloader
  icons={[
    require('./assets/image1.png'),
    require('./assets/image2.png'),
  ]}/>

Available props

  • icons: PropTypes.array,
  • leftRotation: PropTypes.string,
  • rightRotation: PropTypes.string,
  • leftDistance: PropTypes.number,
  • rightDistance: PropTypes.number,
  • speed: PropTypes.number

Contributing

  • Feel free to open PR.

Examples

Expo Example

Most of the credit goes to Dany Rizky for the design inspiration.

License

MIT Licensed

react-native-bouncing-preloader's People

Contributors

sonnylazuardi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.