Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

otp-timer-ts

Package Overview
Dependencies
Maintainers
0
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

otp-timer-ts

A simple react otp timer component with resend functionality🤷

  • 3.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

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

Girl in a jacket

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

Name Type Description
containerClass string timer Container class name
textClass string text class name
timerClass string timer class name
buttonContainerClass string button container class
buttonClass string button class
buttonStyle CSSProperties styles for resend button
buttonContainerStyle CSSProperties styles for resend button container
textStyle CSSProperties styles for text
timerStyle CSSProperties styles for timer
textContainerStyle CSSProperties styles for timer text container

Issues

You are welcome to create an issue.

Stay in touch

License

otp-timer-ts is MIT licensed.

Keywords

FAQs

Package last updated on 26 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc