@akashch/otp-input
v0.3.1
Published
<!-- ALL-CONTRIBUTORS-BADGE:END -->
Downloads
4
Maintainers
Keywords
Readme
@akashch/otp-input
A fully customizable, one-time password input component for the web built with React.
Installation
To install the latest stable version:
npm install --save @akashch/otp-input
Basic usage:
import React, { useState } from "react";
import OtpInput from "@akashch/otp-input";
export default function App() {
const [otp, setOtp] = useState("");
return (
<OtpInput
numValues={6}
inputClass={"any-class"}
parentClass={"any-parent-class"}
onChange={(otp) => {
setOtp(otp);
}}
type={"number"}
/>
);
}
API
Development
To run the vite example:
cd example
npm run dev
Checklist
- [ ] Write tests
- [ ] Add actions for lint checks and tests
Contributing
Feel free to open issues and pull requests!
License
This project follows the all-contributors specification. Contributions of any kind welcome!