A new-password field that checks strength as you type and can generate one.
Import it and pass your content. The props that matter most are listed next.
"use client";
import * as React from "react";
import { PasswordStrength } from "@/components/ui/notchset/password-strength";
// 20 characters from a 64-character alphabet: 120 bits, and n & 63 picks each one without bias.
const ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
const strongPassword = () => Array.from(crypto.getRandomValues(new Uint8Array(20)), (n) => ALPHABET[n & 63]).join("");
export function NewPassword() {
const [password, setPassword] = React.useState("");
// For a strength verdict, pass estimate={(v) => { const r = zxcvbn(v); return { score: r.score, crackTime: r.crackTimesDisplay.offlineSlowHashing1e4PerSecond, warning: r.feedback.warning ?? undefined }; }}
return <PasswordStrength value={password} onValueChange={setPassword} generate={strongPassword} />;
}value / onValueChange–
string / fnControlled.
generate–
() => stringTyped in one character every 34ms, with the field shown.
estimate–
(v) => { score: 0–4, crackTime?, warning? }A vetted estimator (zxcvbn-ts). Without it the meter shows checks and makes no strength claim.
advice–
(checks, estimate, value) => stringThe sentence under the meter.
PasswordStrengthdata-slot="password-strength-root"
Field, meter and advice.
PasswordMeterdata-slot="password-strength"
The meter alone.
components/ui/notchset/password-strength.tsx
pnpm dlx shadcn@latest add https://notchset.dev/r/password-strength.jsonpnpm dlx shadcn@latest add https://notchset.dev/r/radix-nova/password-strength.jsonFree, no account or key. Use the command for your project's primitives: a radix-*, new-york or default style in components.json is Radix, a base-* style is Base UI. With the @notchset registry added, @notchset/<name> picks for you.
The CLI adds the styles to the CSS file named in components.json (tailwind.css). Check that it points at your global stylesheet, that the project uses Tailwind CSS v4, and that the file is imported in your root layout. Installed by hand: paste styles.css into that file.
Give your coding assistant the Markdown guide instead of screenshots.
https://notchset.dev/api/mcp (setup)v1.0.0 · 2026-10-02
First release