npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

styled-react-native-pin-view

v2.1.1

Published

React Native Pin View Component for Protection. This is a modified version from Talut's repo. Updated border style for input. A new fork request will be given once the setup is ready

Downloads

19

Readme

React Native Pin View

Easy, convenient, quick-forming PinView component. It runs smoothly for both IOS and Android, and has only keyboard and input. Thats means you can use everywhere also there is no need to run react-native link

What's new at v2.1.0
TODO's
What was new at v2.0.1

With v2.0.1 user inputted pin will not verified by react-native-pin-view. PinView component will only return the inputted value.

  • returnType added (Return type of inputted value : array or string)
  • onComplete added (This will return inputtedVal and clear() callback) (When user inputted the pin it will run. (Will return inputted value as returnType))
  • pinLength added (User pin length or default pin length for all users.)
  • clear() you can use this in onComplete callback. If you want to clear user input you should call this.

Getting Started

via Yarn

yarn add styled-react-native-pin-view

via NPM

npm install --save styled-react-native-pin-view

Basic Usage


import PinView from 'react-native-pin-view'

...
        <PinView
            onComplete={(val, clear)=>{alert(val)}}
            pinLength={5}
        />

Props

| Prop | Type | Default | Description | Required | | ------------------------ | --------- | ------- | ----------------------------------------------------------------------------------------------------- | -------- | | buttonTextColor | string | #333 | Color of the texts on the number keyboard. | No | | buttonBgColor | string | #FFF | Background of the buttons on the number keyboard | No | | inputBgColor | string | #333 | Input color before entering the pin | No | | inputBgOpacity | number | 0.1 | Input opacity before entering the pin | No | | inputActiveBgColor | string | #333 | The input color that is active when entering the pin. | No | | deleteText | string | DEL | Appears when the user starts entering the pin. | No | | onComplete | func | none | When the user completed input the pin, then inputted value will return. Also clear() is returning too. So if you want to remove user input after onComplete call clear() func in onComplete.| Yes | | returnType | string |string | onComplete returning value type. It can be string or array| No | | pinLength | number | none | (Min length: 3 , Max length: 8) User pin length like this.state.pin.length or 5 If you're using hashed pin then set default length all pin or use pin length. | Yes | | disabled | boolean | false | Optionally, you can set this props true or false. If true, the user can not enter the password. | No | | delayBeforeOnComplete | number | 175 | Optionally, you can set this props for delaying before onComplete event. | No |

Example App

import React, { Component } from 'react';
import { View } from 'react-native';
import PinView from 'react-native-pin-view'

type Props = {};
export default class Master extends Component<Props> {
  constructor(props) {
    super(props);
    this.onComplete = this.onComplete.bind(this);
    this.state = {
        pin: "896745"
    }
  }
  onComplete(inputtedPin, clear) {
  if(val!==this.state.pin){
  clear();
  }else{
  console.log("Pin is correct")
  }
  }
  render() {
    return (
      <View style={ {
        flex           : 1,
        backgroundColor: '#f1f1f1',
        justifyContent : 'center'
      } }>
        <PinView
        onComplete={this.onComplete}
        pinLength={this.state.pin.length}
        // pinLength={6} // You can also use like that.
        />
      </View>
    );
  }
}

Contributors (Thank you all)

Built With

License

This project is licensed under the MIT License - see the LICENSE.md file for details