1.0.0 • Published 4 years ago

react-native-pincode-input-component v1.0.0

Weekly downloads
10
License
MIT
Repository
github
Last release
4 years ago

react-native-pincode-component

A cross-platform customizable PIN code input component for React Native.

Original from https://github.com/xamous/react-native-smooth-pincode-input but improved and changed in some ways.

Features

  • Smooth typing without losing inputs
  • Customizable cell style
  • Customizable text style
  • Password mode
  • Customizable password mask and placeholder characters
  • Built in animations (Credit to react-native-animatable)

Installation

# yarn
yarn add react-native-pincode-input-component

# npm
npm i react-native-pincode-input-component

Available props

Other props are passed down to react-native TextInput!

NameTypeDefaultDescription
containerStyleReact View StyleSheet{}View style for whole container
contentContainerStyleReact View StyleSheet{}View style for the content container
cellStyleReact View StyleSheet{}View style for each cell
cellFocusedStyleReact View StyleSheet{}View style for the focused cell
cellFilledStyleReact View StyleSheet{}View style for the cell if filled
textStyleReact Text StyleSheet{}Text style for the cell
textFocusedStyleReact Text StyleSheet{}Text style for the focused cell
valueString''The value for the input
onValueChangeFunctionnullCallback function that's called when the value changes. Called with: onValueChange(value : string, { isFulfilled: boolean });
codeLengthNumber4Length of the pin input
passwordBooleanfalseMask the input value. Each cell masked with mask prop
placeholderString''Placeholder for each cell
restrictToNumbersBooleanfalseRestrict input to numbers only
cellSizeNumber48Size for each cell in input
cellSpacingNumber4Space between each cell
maskString'*'Value to mask the input with
maskDelayNumber200The delay in milliseconds before a character is masked
animationTypeString, Object'pulse'The animation of the focused cell. This can be a preset animation in the form of a string or a custom animation object.