0.9.2 • Published 4 years ago

@miidx/rn-pin-input v0.9.2

Weekly downloads
4
License
ISC
Repository
github
Last release
4 years ago

rn-pin-input

A React Native pin-input component with time count down. This component will always show empty six pin-input field to be filled later by user.

npm.io

Installation

    npm i @miidx/rn-pin-input

Usage

    <PinInput
        value={'123456'}
        onTextChanged={input => { console.log(input); }}
        pinExpirationDate="2019-12-19T17:32+07:00"
        onPinExpired={() => { console.log('Time is up!'); }}
        countdownLabel={'PIN will expire in'}
    />

Properties

NameDescriptionTypeRequiredDefault value
containerStyleStyle of text input field containerobjectno{}
contentContainerStyleStyle of each pin-input containerobjectno{}
countdownLabelText shown beside time count downstringno''
expiringLabelText shown after reach end time of count downstringno'Pin has expired'
onPinExpiredCallback called when pin has expiredfunctionyes
onTextChangedCallback when text on pin-input field changedfunctionyes
pinExpirationDateExpiring pin time value in complete ISO-8601 date time format YYYY-MM-DDTHH:mmZ. YYYY is 4 digit year, MM is month number, DD is day of month, HH is hours in 24 hour time, mm is minutes, and Z is offset from UTC time, such as +-HH:mm. Adding seconds s and fractional seconds SS are optionalstringyes
textStyleStyle of pin text inside componentobjectno{}
valueComplete number value of pin inputstringyes

Note:

  • This package use rn-count-down component for its count down timer to read the documentation, click here.