0.3.1 • Published 2 years ago

@akashch/otp-input v0.3.1

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

@akashch/otp-input

A fully customizable, one-time password input component for the web built with React.

Installation

NPM

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

PRs Welcome Open Source Love

  • Write tests
  • Add actions for lint checks and tests

Contributing

Feel free to open issues and pull requests!

License

NPM

This project follows the all-contributors specification. Contributions of any kind welcome!