A customizable OTP input component for React Native with TypeScript support, enabling seamless user authentication with flexible input handling and cross-platform compatibility.
Installations
npm install @codsod/react-native-otp-input
Developer Guide
Typescript
Yes
Module System
ESM
Node Version
18.18.2
NPM Version
9.8.1
Score
69.3
Supply Chain
86.5
Quality
77.9
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
codsode
Download Statistics
Total Downloads
504
Last Day
11
Last Week
29
Last Month
98
Last Year
504
GitHub Statistics
3 Commits
1 Watching
1 Branches
2 Contributors
Package Meta Information
Latest Version
1.0.2
Package Id
@codsod/react-native-otp-input@1.0.2
Unpacked Size
7.97 kB
Size
2.98 kB
File Count
4
NPM Version
9.8.1
Node Version
18.18.2
Publised On
20 Oct 2024
Total Downloads
Cumulative downloads
Total Downloads
504
Last day
175%
11
Compared to previous day
Last week
26.1%
29
Compared to previous week
Last month
-6.7%
98
Compared to previous month
Last year
0%
504
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
5
@codsod/react-native-otp-input
A customizable OTP input component for React Native, designed to simplify user authentication through one-time passwords. This package offers an intuitive interface and flexible functionality, making it ideal for mobile applications.
Features
- Easy-to-Use API: Quickly integrate OTP input functionality into your applications.
- Customizable Length: Specify the number of input fields for your OTP.
- Cross-Platform Support: Optimized for both iOS and Android devices, as well as desktop web.
- Seamless Focus Management: Automatically shifts focus between input fields, enhancing user experience.
- TypeScript Support: Fully typed for better development experience and error checking.
Installation
To install the package, use npm or yarn:
1npm install @codsod/react-native-otp-input
Complete Example:
1import React, { View } from "react"; 2import OTPInput from "@codsod/react-native-otp-input"; 3 4const Home = () => { 5 const [otp, setOTP] = useState(""); 6 7 return ( 8 <View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}> 9 <OTPInput length={6} onOtpComplete={(txt: string) => setOTP(txt)} /> 10 </View> 11 ); 12}; 13 14export default Home;
Props
Prop | Type | Description | Default |
---|---|---|---|
length | number | The number of input fields for the OTP. | 4 |
onOtpComplete | Function | Callback fired when the OTP input is complete, receiving the entered OTP. | - |
style | style | Custom styles for the OTP container. | - |
inputStyle | style | Custom styles for each input field. | - |
Key Changes and Improvements
-
Title and Description: Adjusted the title and description to focus on OTP input functionality instead of chat interfaces.
-
Features Section: Clearly listed relevant features that are specific to OTP input, highlighting usability and flexibility.
-
Installation and Usage: Improved the example code for clarity and usability. Included more context in the example for better understanding.
-
Props Table: Corrected the descriptions of props to accurately reflect their purposes.
-
Contribution and License Sections: Added these sections to encourage community engagement and clarify the licensing.
Conclusion
Feel free to modify any sections further to better align with your branding or preferences. This README should provide a solid foundation for users to understand and utilize your OTP input component effectively! If you have any more requests or need further assistance, let me know!
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No security vulnerabilities found.