1.1.6 • Published 6 months ago

otp-mtolia v1.1.6

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Status GitHub Issues GitHub Pull Requests License


📝 Table of Contents

🧐 About

With this library, you can get a ready input where you can get your one-time passwords from the user and style it. The user can fill in the input with a single button on the clipboard on ios devices.

🏁 Getting Started

This package is made for reactjs. First, review the Prerequisites section below. And if there is a missing package in your project, install it.

Prerequisites

What things you need to install the software and how to install them.

npm i react
npm i typescript

Installing

Firstly, add the npm package to your project by typing the following line into the terminal.

npm i otp-mtolia

🎈 Usage

With React Hook Form

import OtpInput from "otp-mtolia";
import React from "react";
import { Controller, SubmitHandler, useForm } from "react-hook-form";
import styles from "../otp/otp.module.scss";

interface otpForm {
  otp: any;
}

export const OtpScreen = () => {
  //#region Form & Submit
  const {
    handleSubmit,
    formState: { errors, isSubmitted, isValid },
    setValue,
  } = useForm < otpForm > {};

  const onSubmit: SubmitHandler<otpForm> = (data) => {
    console.log(data);
  };

  //#endregion

  //#region JSX
  return (
    <div className={styles.otpScreen}>
      <h4>OTP Page</h4>

      <form onSubmit={handleSubmit(onSubmit)}>
        {/* OTP From Package*/}
        <OtpInput inputCount={6} onChangedOtp={(value: string) => setValue("otp", value)} inputClassName={styles.otpInput} />

        <button type="submit"> Submit </button>
      </form>
    </div>
  );
  //#endregion
};

⛏️ Built Using

✍️ Authors

1.1.6

6 months ago

1.1.5

6 months ago

1.1.1

2 years ago

1.0.19

2 years ago

1.1.0

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.0.22

2 years ago

1.0.19-1

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.29

2 years ago

1.0.27

2 years ago

1.0.30

2 years ago

1.0.15-4

2 years ago

1.0.15-3

2 years ago

1.0.15-2

2 years ago

1.0.15-1

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago