3.0.1 • Published 7 months ago

otp-timer-ts v3.0.1

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

otp-timer-ts

A simple and customizable react otp timer component with typescript support. very simple and more customizable design and smallest bundle size about 13kb. You can use this component into any react and nextjs projects.

npm downloads PRs Welcome MIT licensed

  • SSR Friendly
  • Customizable
  • TypeScript Support
  • Smallest Bundle Size(About 13kb)

Installation

$ npm i otp-timer-ts --save

Demo

Usage?

import { Otptimer } from "otp-timer-ts";

const Home = () => {
  const handleResend = () => {
    //desired function to be performed on clicking resend button
  }
  return (
    <div>
      <Otptimer minutes={0} seconds={5} onResend={handleResend} />
    </div>
  );
};

export default Home;

Options

nameDescriptionDefault Value
secondsnumber of seconds for which timer must be set30
minutesnumber of minutes for which the timer must be set0
onResendfunction that would get triggered on clicking the resend buttonn/a
textcontent that you want to put downResend otp in
ButtonTextbutton textResend
showSpinnerIf you want to show any button loadingfalse
fetchingIf you want to show any button loading icon with fetching statefalse
spinnerComponentYour custom spinner component for rendernull

Styling

Issues

You are welcome to create an issue.

Stay in touch

License

otp-timer-ts is MIT licensed.

3.0.1

7 months ago

3.0.0

7 months ago

2.1.4

1 year ago

2.1.5

1 year ago

2.1.3

1 year ago

2.1.2

1 year ago

2.1.1

1 year ago

2.1.0

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

1.0.0-beta-2

1 year ago

1.0.0-beta-1

1 year ago