0.1.2 ā€¢ Published 2 years ago

mroom-react-otp-input v0.1.2

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

Mroom-UI: OTP Component for react

šŸ”‘ A simple One Time Password verification input for your react application.

Installation

bower install mroom-react-otp-input

# or

npm install mroom-react-otp-input

Example

import React from "react";
import OneTimePasswordInput from "./components/OneTimePasswordInput";

function App() {
  return (
    <OneTimePasswordInput onVerifyCode={(input) => input === "000000"} />
  );
}

export default App;

Features

  • Configure inputs numbers based on your needs.
  • Supports tab and backspace keyboard events.

API

PropsTypeDescriptionDefault
digitInputCountNumberSpecify how many input you want for your otp verification length6
disableVerificationStatusBooleanHide the verification status below the digit inputs.false
wrapperStyleObjectCustomize the global wrapper style containing the inputs{}
inputStyleObjectCustomize the style of the inputs{}
onVerifyCodefunctionA callback function required to use in order to verify the input with a backend verification code.-

TODOS

PRs Welcome Open Source Love

  • [] Migrate it to typescript
  • [] Improve performance.
  • [] Write tests

Note

This is my first time building a small component for the open-source šŸŒŽ. I will be so thunkfull šŸ™ if you send me your feedback and recommendations.

Socials

Made with ā¤ļø by Mounir Hamzaoui