
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
A highly customizable React component library for password strength checking and validation.
usePasswordStrength hook for complete UI control# npm
npm install passwise
# yarn
yarn add passwise
# pnpm
pnpm add passwise
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>
);
}
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}
/>
);
}
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}
))}
)}
);
}
| 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 |
interface PasswordPolicy {
minLength?: number;
maxLength?: number;
mustContain?: {
lowercase?: boolean;
uppercase?: boolean;
number?: boolean;
symbol?: boolean;
};
}
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;
}
This library provides default styling using TailwindCSS. The classes are prefixed with pw- to avoid conflicts with your application's own Tailwind classes.
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.
MIT
FAQs
A customizable React password strength checker library
We found that passwise demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.