Giter Site home page Giter Site logo

trellixvulnteam / react-native-pins_mw2r Goto Github PK

View Code? Open in Web Editor NEW

This project forked from qeepsake/react-native-pins

0.0 0.0 0.0 14.01 MB

Pins for displaying progress (active / non-active) with animation and feedback ⚫⚫⚪⚪⚪

Shell 1.53% JavaScript 98.47%

react-native-pins_mw2r's Introduction

react-native-pins

npm npm licence npm downloads


The pins come with a shake animation and configurable device vibration.

Install

To get started install via npm:

 npm install react-native-pins

Usage

Import:

 import { Pins } from 'react-native-pins';

Then add it to your code:

<Pins
    onRef={ref => (this.pins = ref)}
    numberOfPins={5}
    numberOfPinsActive={2}
    numberOfPinsMaximum={2}
    activeOnly
/>

The <Pins /> has a shake() method which can be called through a reference this.pins.shake(). This will perform a shake animation and vibration if enabled. A callback can be passed through props which will be fired when the animation is complete. See props below.

Pins

Prop Type Optional Default Description
onRef any Yes onRef allows you to call the shake() method.
activeOnly booolean yes false Whether to only fill the active pin or to fill all of them.
spacing number yes 15 The space between the pins
pinSize number yes 18 The size of the pins
numberOfPins number Yes 5 Number of pins to render.
numberOfPinsActive number Yes 0 Number of active pins. You can pass the pin.length here.
vibration bool Yes true Should vibration be enabled on shake?
animationShakeCallback func Yes A callback triggered when the pin shake animation has finished.
containerStyle object Yes See Pins.js Style applied to PINS container.
pinStyle object Yes See Pins.js Style applied to each circle PIN.
pinActiveStyle object Yes See Pins.js Style applied to each circle PIN when it is active.
numberOfPinsMaximum number Yes This property is used to set a maximum number of pins to show. If specified, then the pins will have an animation effect, as showcased in the demo above.

Contributors

Thanks goes to these wonderful people (emoji key):


Luke Brandon Farrell

💻 📖

Rodrigo Vieira

💻

Denise Ng

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

License

This project is licensed under the MIT License

react-native-pins_mw2r's People

Contributors

chestersim avatar denise-ng avatar leonardoballand avatar lukebrandonfarrell avatar rodriigovieira avatar trellixvulnteam 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.