Gathering detailed insights and metrics for react-native-smooth-pincode-input
Gathering detailed insights and metrics for react-native-smooth-pincode-input
Gathering detailed insights and metrics for react-native-smooth-pincode-input
Gathering detailed insights and metrics for react-native-smooth-pincode-input
simple-pincode-input
Fork of react-native-smooth-pincode-input
@zfloc/react-native-smooth-pincode-input
A cross-platform, smooth, lightweight, customizable PIN code input component for React Native.
@dreamwalk-os/react-native-smooth-pincode-input
A cross-platform, smooth, lightweight, customizable PIN code input component for React Native.
@svgr/cli
SVGR command line.
npm install react-native-smooth-pincode-input
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
406 Stars
79 Commits
140 Forks
4 Watching
22 Branches
18 Contributors
Updated on 24 Oct 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-8.1%
1,287
Compared to previous day
Last week
-1.3%
6,448
Compared to previous week
Last month
4%
28,189
Compared to previous month
Last year
8.3%
316,086
Compared to previous year
2
1
A cross-platform, smooth, lightweight, customizable PIN code input component for React Native.
Most PIN code inputs components implemented by combining several TextInputs. They works, however, not good enough. When user types fast, or system sluggish, characters may lost when component switching focus between TextInputs. User need to type over and over again to get a correct input, gave a frustrated user experience.
React Native Smooth Pincode Input implemented with a different approach - It's based on single TextInput but only render it as seperated fields. In other words, it looks like a PIN code input, but works as smooth as a native TextInput.
React Native Smooth Pincode Input is also highly customizable. By exposing cells and text stylesheets, it can be fully customized to fit in your app design. Password mode also supported with customizable mask characters as well as placeholders.
1# yarn 2yarn add react-native-smooth-pincode-input 3 4# npm 5npm i react-native-smooth-pincode-input
1<SmoothPinCodeInput 2 ref={this.pinInput} 3 value={code} 4 onTextChange={code => this.setState({ code })} 5 onFulfill={this._checkCode} 6 onBackspace={this._focusePrevInput} 7 />
1<SmoothPinCodeInput password mask="﹡" 2 cellSize={36} 3 codeLength={8} 4 value={password} 5 onTextChange={password => this.setState({ password })}/>
1<SmoothPinCodeInput 2 cellStyle={{ 3 borderBottomWidth: 2, 4 borderColor: 'gray', 5 }} 6 cellStyleFocused={{ 7 borderColor: 'black', 8 }} 9 value={code} 10 onTextChange={code => this.setState({ code })} 11 />
1<SmoothPinCodeInput 2 placeholder="â‘" 3 cellStyle={{ 4 borderWidth: 2, 5 borderRadius: 24, 6 borderColor: 'mediumturquoise', 7 backgroundColor: 'azure', 8 }} 9 cellStyleFocused={{ 10 borderColor: 'lightseagreen', 11 backgroundColor: 'lightcyan', 12 }} 13 textStyle={{ 14 fontSize: 24, 15 color: 'salmon' 16 }} 17 textStyleFocused={{ 18 color: 'crimson' 19 }} 20 value={code} 21 onTextChange={code => this.setState({ code })} 22 />
1<SmoothPinCodeInput 2 placeholder={<View style={{ 3 width: 10, 4 height: 10, 5 borderRadius: 25, 6 opacity: 0.3, 7 backgroundColor: 'blue', 8 }}></View>} 9 mask={<View style={{ 10 width: 10, 11 height: 10, 12 borderRadius: 25, 13 backgroundColor: 'blue', 14 }}></View>} 15 maskDelay={1000} 16 password={true} 17 cellStyle={null} 18 cellStyleFocused={null} 19 value={code} 20 onTextChange={code => this.setState({ code })} 21/>
Name | Type | Default | Description |
---|---|---|---|
value | String | '' | The value to show for the input |
codeLength | Number | 4 | Number of character for the input |
cellSize | Number | 48 | Size for each cell in input |
cellSpacing | Number | 4 | Space between each cell |
placeholder | String | Element | '' |
mask | String | Element | '*' |
maskDelay | Number | 200 | The delay in milliseconds before a character is masked |
password | Boolean | false | Mask the input value. Each cell masked with mask props |
autoFocus | Boolean | false | If true, focuses the input on componentDidMount |
editable | Boolean | true | If false, makes each cell not editable |
animated | Boolean | true | Toggle animations |
animationFocused | String, 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. |
restrictToNumbers | Boolean | false | Restrict input to numbers only |
containerStyle | React View StyleSheet | {} | View style for whole cell containers |
cellStyle | React View StyleSheet | { borderColor: 'gray', borderWidth: 1} | View style for each cell |
cellStyleFocused | React View StyleSheet | { borderColor: 'black', borderWidth: 2 } | View style for focused cell |
textStyle | React Text StyleSheet | { color: 'gray', fontSize: 24 } | Text style for cell value |
textStyleFocused | React Text StyleSheet | { color: 'black' } | Text style for focused cell value |
onFulfill | Function | null | Callback function that's called when the input is completely filled |
onTextChange | Function | null | Callback function that's called when the text changed |
onBackspace | Function | null | Callback function that's called when the input is empty and the backspace button is pressed |
keyboardType | Enum('default', 'number-pad', 'decimal-pad', 'numeric', 'email-address', 'phone-pad') | 'numeric' | Determines which keyboard to open |
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 9/12 approved changesets -- score normalized to 7
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
114 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More