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

@nerdydave2017/react-native-pin-input

v1.0.0

Published

A fully accessible and customizable PIN input component for React Native, built with a single hidden TextInput for a native-like experience.

Readme

React Native PIN Input

A fully accessible and customizable PIN/OTP input component for React Native.

Built with a single hidden TextInput for a native-like experience, including keyboard management, copy-paste, and OTP autofill, without the complexity.

Demo

Demo GIF

Features

  • Drop-in Replacement: Extends TextInputProps so you can use it just like a native TextInput.
  • ♿️ Fully Accessible: Works seamlessly with password managers and screen readers.
  • 📋 Copy & Paste: Full copy-paste support, including OTP suggestions from messages (textContentType="oneTimeCode").
  • 🎨 Customizable: Style all elements of the component using standard StyleSheet props.

Installation

npm install @nerdydave2017/react-native-pin-input
# or
yarn add @nerdydave2017/react-native-pin-input
# or
pnpm add @nerdydave2017/react-native-pin-input

Basic Usage

import React, { useState } from "react";
import { PinInput } from "@nerdydave2017/react-native-pin-input";

const MyScreen = () => {
  const [pin, setPin] = useState("");

  return (
    <PinInput
      pinLength={6}
      onPinChange={setPin}
      onPinComplete={(completePin) => {
        console.log("PIN entry complete:", completePin);
      }}
      autoFocus
    />
  );
};

Styled Usage

import React, { useState } from "react";
import { PinInput } from "@nerdydave2017/react-native-pin-input";

const MyScreen = () => {
  const [pin, setPin] = useState("");

  return (
    <PinInput
      pinLength={6}
      onPinChange={setPin}
      onPinComplete={(completePin) => {
        console.log("PIN entry complete:", completePin);
      }}
      cellStyle={{
        width: 60,
        height: 60,
      }}
      focusedCellStyle={{
        borderColor: "green",
        borderWidth: 2,
      }}
      autoFocus
    />
  );
};

Props

Since this component extends TextInputProps, you can pass any standard TextInput prop. Here are the component-specific props:

| Prop | Type | Default | Description | | --- | --- | --- | --- | | pinLength | number | Required | The number of digits in the PIN. | | onPinChange | (pin: string) => void | undefined | Callback that fires when the PIN value changes. | | onPinComplete | (pin: string) => void | undefined | Callback that fires when all digits are filled. | | containerStyle | ViewStyle | undefined | Style for the container view holding the cells. | | cellStyle | ViewStyle | undefined | Style for an individual digit cell. | | focusedCellStyle | ViewStyle | undefined | Style for the currently focused digit cell. | | cellTextStyle | TextStyle | undefined | Style for the text inside a digit cell. |

Roadmap & Future Features

Here is the planned rollout for new features to make this package a more robust solution.

Phase 1: Enhanced Styling & Security

  • Custom Error Styling: Add props to style the input cells when they are in an error state.
  • Secure Text Entry: Introduce a secureTextEntry prop to mask digits for password or OTP entry, with customizable placeholder characters.

Phase 2: Rich User Feedback & Interaction

  • Shake Animation on Error: Provide intuitive visual feedback by adding a shake animation when an incorrect PIN is entered.
  • Cursor/Caret Animation: Implement an optional blinking cursor in the active cell to improve usability.

Phase 3: Advanced Customization & API

  • Fully Custom Cell Rendering: Allow developers to render completely custom components for each input cell via a renderCell prop.
  • Generalized Animations API: Expose an API to allow developers to define their own animations for different states like onFocus, onBlur, and onError.

License

MIT