npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

smooth-otp

v2.0.9

Published

A fast and small OTP input component for React/Nextjs - Debraj

Downloads

57

Readme

SmoothOTP Component

The SmoothOTP component is a flexible and user-friendly React component for inputting One-Time Passwords (OTPs). It supports two modes (slots and single-field), copy-pasting in the slots mode (including support for Android and iOS), and customizable styling.

Features

  • Two Modes:

    • slots: Separate input boxes for each OTP digit.
    • single-field: A single input box for the entire OTP.
  • Copy-Paste Support: Allows users to paste the OTP directly into the slots mode, with the pasted value distributed across the fields automatically.

  • Keyboard Navigation:

    • Auto-focus on the next field after entering a digit.
    • Backspace moves focus to the previous field if the current field is empty.
  • Customization:

    • Configurable length of OTP.
    • Custom class names for styling.
    • Adjustable spacing between inputs in slots mode.

Installation

npm install smooth-otp

Component API

alt text

Example Usage

import React from "react";
import { SmoothOTP } from "./SmoothOTP";

const App = () => {
  const handleComplete = (otp: string) => {
    console.log("Completed OTP:", otp);
  };

  return (
    <SmoothOTP
      length={6}
      type="slots"
      onComplete={handleComplete}
    />
  );
};

export default App;

Advance Customization

<SmoothOTP
  length={4}
  type="slots"
  onComplete={(otp) => console.log(otp)} 
  className="custom-otp-container"  // you can use tailwind classes here for outer layer
  inputClassName="custom-otp-input" // you can use tailwind classes here for inner layer
  spacing={10}
/>

Contributing

  • We welcome contributions! Follow these steps:
  • Fork the repository.
  • Create a branch for your feature or bug fix.
  • Submit a pull request describing your changes.

License

This project is licensed under the MIT License.

Upcoming Features

  • AUTO OTP Read for mobile devices (Android / IOS)
  • AUTO OTP Read for desktop browsers (https://developer.chrome.com/docs/identity/cross-device-webotp)
  • ARIA attribute addition