Socket
Socket
Sign inDemoInstall

react-native-simple-pin

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-simple-pin

Super simple and minimalistic PIN Code component


Version published
Maintainers
1
Install size
8.10 kB
Created

Readme

Source

react-native-simple-pin

Super simple and minimalistic PIN Code component for React Native

pincode

Installation

yarn add react-native-simple-pin

or

npm install --save react-native-simple-pin

Usage

Set PIN

To set PIN you need to pass into pin prop pin code length

import React from 'react';
import SimplePin from 'react-native-simple-pin'
import { Alert } from 'react-native'

const PinCodeScreenComponent = ({}) => (
    <SimplePin
        pin={4}
        title="Set my very secret PIN"
        repeatTitle="Repeat your PIN"
        onSuccess={(pin) => Alert.alert(
            'Success',
            'Hell yeah! Your PIN is ' + pin.join(''),
            [
                { text: 'OK' },
            ]
        )}
        onFailure={() => Alert.alert(
            'Failure',
            'Please, try again',
            [
                { text: 'OK' },
            ]
        )}
        titleStyle={{ fontSize: 23 }}
        numpadTextStyle={{ fontSize: 27 }}
        bulletStyle={{fontSize:25}}
    />
)

export default PinCodeScreenComponent

Check PIN

To check PIN you need to pass into pin prop array with numbers of your PIN

import React from 'react';
import SimplePin from 'react-native-simple-pin'
import { Alert } from 'react-native'

const PinCodeScreenComponent = ({}) => (
    <SimplePin
        pin={[1,2,3,4]}
        title="Enter your PIN"
        onSuccess={() => Alert.alert(
            'Success',
            'Hell yeah!',
            [
                { text: 'OK' },
            ]
        )}
        onFailure={() => Alert.alert(
            'Failure',
            'Please, try again',
            [
                { text: 'OK' },
            ]
        )}
        titleStyle={{ fontSize: 23 }}
        numpadTextStyle={{ fontSize: 27 }}
        bulletStyle={{fontSize:25}}
    />
)

export default PinCodeScreenComponent

Props

NameDescriptionDefaultRequiredType
pinPin value to verify or length of pin to set-YesArray/Number
onSuccessFunction to be used when Pin code pass verificationYesFunction
onFailureFunction to be used when Pin code fails on verificationYesFunction
titleText that be dispayed on topEnter your PINNoString
repeatTitleText that be dispayed on repeat PINRepeat your PINNoString
titleStyleStyle object for title{fontSize: 20}NoObject
numpadTextStyleStyle object for button on numpad{fontSize: 27, textAlign: 'center'}NoObject
bulletStyleStyle object for bullet{fontSize: 27}NoObject

Keywords

FAQs

Last updated on 29 Aug 2019

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