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

passwise

v0.1.5

Published

A customizable React password strength checker library

Readme

Passwise

A highly customizable React component library for password strength checking and validation.

npm version License: MIT TypeScript

Features

  • 🔒 Robust Security Analysis: Uses the battle-tested zxcvbn library originally created by Dropbox for password strength estimation
  • 🎨 Fully Customizable UI: Light and dark theme support with further customization options
  • 🧩 Headless Option: Use the usePasswordStrength hook for complete UI control
  • 📏 Custom Password Policies: Define your own password requirements
  • 🔄 Real-time Feedback: Strength meter, validation state, and improvement suggestions
  • 📦 Modern Bundle: Tree-shakable ESM and CommonJS builds
  • 📝 Type-safe: Written in TypeScript with comprehensive type definitions
  • 🎯 Optional TailwindCSS: Styling with Tailwind, but also works without it

Installation

# npm
npm install passwise

# yarn
yarn add passwise

# pnpm
pnpm add passwise

Usage

Basic Example

import React, { useState } from "react";
import { PasswordStrengthMeter } from "passwise";

function PasswordForm() {
  const [password, setPassword] = useState("");

  return (
    <div>
      <input
        type="password"
        value={password}
        onChange={(e) => setPassword(e.target.value)}
      />

      <PasswordStrengthMeter
        password={password}
        theme="dark"
        policy={{
          minLength: 8,
          mustContain: {
            lowercase: true,
            uppercase: true,
            number: true,
            symbol: true,
          },
        }}
      />
    </div>
  );
}

With Custom Password Policy

import React, { useState } from 'react';
import { PasswordStrengthMeter } from 'passwise';

function PasswordFormWithPolicy() {
  const [password, setPassword] = useState('');

  // Define a custom password policy
  const passwordPolicy = {
    minLength: 8,
    mustContain: {
      lowercase: true,
      uppercase: true,
      number: true,
      symbol: true
    }
  };

  return (

      <input
        id="password"
        type="password"
        value={password}
        onChange={(e) => setPassword(e.target.value)}
      />

    <PasswordStrengthMeter
        password={password}
        theme="dark"
        policy={passwordPolicy}
      />


  );
}

Using the Hook (Headless)

import React, { useState } from 'react';
import { usePasswordStrength } from 'passwise';

function CustomPasswordUI() {
  const [password, setPassword] = useState('');

  // Use the headless hook
  const strengthResult = usePasswordStrength({
    password,
    policy: {
      minLength: 10
    }
  });

  // Create your own UI based on the strength result
  return (

      <input
        type="password"
        value={password}
        onChange={(e) => setPassword(e.target.value)}
      />


        Strength score: {strengthResult.score}/4
        Rating: {strengthResult.label}

        {strengthResult.feedback.warning && (
          Warning: {strengthResult.feedback.warning}
        )}

        {strengthResult.feedback.suggestions.length > 0 && (

            {strengthResult.feedback.suggestions.map((suggestion, i) => (
              {suggestion}
            ))}

        )}


  );
}

API Reference

PasswordStrengthMeter Props

| Prop | Type | Default | Description | | ----------------- | ---------------------------------------- | ----------------------------------------------- | ------------------------------------- | | password | string | required | The password to evaluate | | theme | 'light' | 'dark' | 'light' | UI theme | | className | string | '' | Additional CSS classes | | showLabels | boolean | true | Show strength labels | | showBar | boolean | true | Show strength bar | | showSuggestions | boolean | true | Show validation and suggestions | | scoreWords | [string, string, string, string, string] | ['Very Weak', 'Weak', 'Fair', 'Good', 'Strong'] | Custom labels for each strength level | | policy | PasswordPolicy | undefined | Custom password requirements | | barOnly | boolean | false | Show only the strength bar | | onChange | (result: PasswordStrengthResult) => void | undefined | Callback when strength changes |

PasswordPolicy Object

interface PasswordPolicy {
  minLength?: number;
  maxLength?: number;
  mustContain?: {
    lowercase?: boolean;
    uppercase?: boolean;
    number?: boolean;
    symbol?: boolean;
  };
}

PasswordStrengthResult Object

interface PasswordStrengthResult {
  score: 0 | 1 | 2 | 3 | 4; // 0 = weakest, 4 = strongest
  label: "Very Weak" | "Weak" | "Fair" | "Good" | "Strong";
  feedback: {
    suggestions: string[];
    warning: string | null;
  };
  passwordLength: number;
  validations: PasswordValidationResult[];
  meetsPolicy: boolean;
}

Styling and Customization

Using TailwindCSS

This library provides default styling using TailwindCSS. The classes are prefixed with pw- to avoid conflicts with your application's own Tailwind classes.

Without TailwindCSS

If you're not using TailwindCSS, the components will still work, but you might want to provide your own styling via the className prop and CSS.

License

MIT