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

react-pattern-lock-ts

v3.2.5

Published

PatternLock is a lightweight and customizable React component for implementing a secure and interactive pattern lock system. Perfect for authentication, games, or creative applications, it supports touch and mouse interactions with real-time state updates

Readme

🚀 React Pattern Lock 🔒

A customizable pattern lock component for React applications. This component creates a 3x3 grid of points that users can connect to create patterns, similar to Android's pattern lock system.

📥 Installation

npm install "react-pattern-lock-ts

Or with yarn:

yarn add "react-pattern-lock-ts

✨ Features

  • Supports both mouse and touch interactions
  • Customizable styling through CSS classes
  • Optional number display on points
  • Pattern tracking and state management
  • Responsive design
  • TypeScript support

Usage

import PatternLock from 'react-pattern-lock-ts';
import { useState } from 'react';

function App() {
  const [patterns, setPatterns] = useState<number[][]>([]);

  return (
    <PatternLock
      setPatterns={setPatterns}
      useNumber={true}
      className="custom-bullet"
      numberClassName="custom-number"
      bgClassName="custom-background"
    />
  );
}

Props

| Prop | Type | Default | Description | | -------------------- | --------------------------------------------- | ------------------ | --------------------------------- | | setPatterns | (value: SetStateAction<number[][]>) => void | Required | Function to update patterns state | | useNumber | boolean | false | Show numbers (0-8) on the points | | className | string | 'bullet-bYMyWeb' | Custom class for points | | numberClassName | string | - | Custom class for numbers | | bgClassName | string | 'bg-bYMyWeb' | Custom class for background | | resetStyleByChange | any | - | Trigger to reset pattern |

Styling

The component comes with default styles but can be customized using CSS classes. Default classes include:

  • pattern-content-bYMyWeb: Container styling
  • bullet-content-bYMyWeb: Points container styling
  • bullet-bYMyWeb: Individual point styling
  • active-bullet-bYMyWeb: Active point styling
  • bg-bYMyWeb: Background styling

Example CSS

.pattern-content-bYMyWeb {
   position: relative;
   width: 100%;
   aspect-ratio: 1;
}

.bullet-content-bYMyWeb {
   display: grid;
   grid-template-columns: repeat(3, 1fr);
   gap: 20px;
   padding: 20px;
}

.bullet-bYMyWeb {
   width: 40px;
   height: 40px;
   border-radius: 50%;
   background: #ddd;
   cursor: pointer;
}

.active-bullet-bYMyWeb {
   background: #007bff;
}

Pattern Data Structure

The pattern is returned as an array of numbers (0-8), representing the points in order of selection. For example:

[
  [0, 1, 2], // First pattern
  [3, 4, 5]  // Second pattern
]

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)
  • Mobile browsers with touch support

📄 License

MIT © [Mohammad Gholami]

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Made with ❤️ using TypeScript