A new-password field with a 16-node meter that lights one node per 5 bits, the level and time to crack on one line, a sentence of advice, and a Generate key that types a passphrase in.
pnpm dlx shadcn@latest add @beautiful-ui-pro/password-strengthNeeds your registry key. Your components.json style picks the Base UI or Radix build: radix-*, new-york and default get Radix, base-* gets Base UI.
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.
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";
const WORDS = ["copper", "orbit", "lantern", "meadow", "signal", "harbor", "violet", "summit"];
const passphrase = () => Array.from({ length: 4 }, () => WORDS[Math.floor(Math.random() * WORDS.length)]).join("-");
export function NewPassword() {
const [password, setPassword] = React.useState("");
return <PasswordStrength value={password} onValueChange={setPassword} generate={passphrase} />;
}value / onValueChange–
string / fnControlled.
generate–
() => stringTyped in one character every 34ms, with the field shown.
score–
(v) => { bits, common }Your scorer (zxcvbn-ts in production); the visual stays.
advice–
(level, strength) => stringThe sentence under the meter.
components/ui/notchset/password-strength.tsx
This component is included with Pro.
Try the live preview above. Get Pro to install the source.