Socket
Socket
Sign inDemoInstall

react-native-pins

Package Overview
Dependencies
0
Maintainers
5
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-pins

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


Version published
Weekly downloads
6
decreased by-81.82%
Maintainers
5
Install size
352 kB
Created
Weekly downloads
 

Readme

Source

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
PropTypeOptionalDefaultDescription
onRefanyYesonRef allows you to call the shake() method.
activeOnlyboooleanyesfalseWhether to only fill the active pin or to fill all of them.
spacingnumberyes15The space between the pins
pinSizenumberyes18The size of the pins
numberOfPinsnumberYes5Number of pins to render.
numberOfPinsActivenumberYes0Number of active pins. You can pass the pin.length here.
vibrationboolYestrueShould vibration be enabled on shake?
animationShakeCallbackfuncYesA callback triggered when the pin shake animation has finished.
containerStyleobjectYesSee Pins.jsStyle applied to PINS container.
pinStyleobjectYesSee Pins.jsStyle applied to each circle PIN.
pinActiveStyleobjectYesSee Pins.jsStyle applied to each circle PIN when it is active.
numberOfPinsMaximumnumberYesThis 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

Keywords

FAQs

Last updated on 03 Jun 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc