Skip to content

Commit fe91151

Browse files
committed
Uploaded Package
0 parents  commit fe91151

File tree

6 files changed

+1522
-0
lines changed

6 files changed

+1522
-0
lines changed

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
node_modules/
2+
.expo/
3+
npm-debug.*
4+
*.jks
5+
*.p8
6+
*.p12
7+
*.key
8+
*.mobileprovision
9+
*.orig.*
10+
web-build/
11+
12+
# macOS
13+
.DS_Store

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# OTP Input
2+
3+
## Basic Usage
4+
5+
```javascript
6+
const [OTP, SetOTP] = useState("");
7+
// Maintain a state variable
8+
9+
// Use it like this
10+
<OTPInput
11+
onChangeText={SetOTP}
12+
value={OTP}
13+
...
14+
15+
/>
16+
```
17+
18+
![OTP Input Demo GIF](https://i.imgur.com/ZKOv0Pa.gif)
19+
20+
## Parameters
21+
22+
| Parameter | required | Default | Description |
23+
| ------------------- | -------- | ------- | ------------------------------------------------------------------------- |
24+
| value | YES | | Maintain a state in parent component and use it as a controlled input |
25+
| onChangeText | YES | | the onChangeText function to update the state in parent component |
26+
| length | NO | 6 | Number of digits in the OTP |
27+
| autoFocus | NO | false | Whether to autofocus the first field |
28+
| headerTitle | NO | | The header Title above the OTP fields |
29+
| headerTitleStyle | NO | {} | header title styles |
30+
| headerTitleColor | NO | black | header title color |
31+
| activeBorderColor | NO | #03DAC6 | Color of the border bottom line if the input field is focused |
32+
| disabledBorderColor | NO | grey | Color of the blurred input fields. i.e, the fields which are out of focus |
33+
| activeBorderWidth | NO | 3 | Border Width of focused field |
34+
| disabledBorderWidth | NO | 1 | Border Width of fields which are out pof focus |
35+
| children | NO | null | children for the component if any |
36+
| HeaderComponent | NO | null | component to show above the OTP component |
37+
| FooterComponent | NO | null | component to show below the OTP component |
38+
| containerStyle | NO | {} | styles for the container that holds the whole component |
39+
| OTPContainerStyle | NO | {} | styles for the OTP container |
40+
| TextInputStyle | NO | {} | styles for the Input fields |

index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import OTPInput from "./src/OTPInput";
2+
3+
export { OTPInput };

0 commit comments

Comments
 (0)