Password Hint Guard

Password Hint Guard is a copy-paste React component that stops password hint reveals the password before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/password-hint-guard
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 1 extra npm package
  • A11y guidance in docs

StopsPassword hint reveals the password

Was this component page useful?

How do I install Password Hint Guard?

pnpm dlx shadcn@latest add @bollard/password-hint-guard

The files land in your project. They're yours to edit.

How do I use Password Hint Guard in React?

password-hint-guard-usage.tsx
import { PasswordHintGuard } from "@/components/ui/password-hint-guard"

<PasswordHintGuard password={password} value={hint} onValueChange={setHint} />

What input mistakes does Password Hint Guard catch?

  • The password written in the hint
  • Reversed, spaced-out or leetspeak versions (P@ssw0rd)
  • A long shared substring of the password
  • Admissions of reuse such as "same as my bank"

What props does Password Hint Guard accept?

PasswordHintGuard props
PropTypeDefault
password* (required)

The password chosen in the same form. Only compared, never shown or stored.

string—
value

Controlled hint or answer.

string—
defaultValue

Initial hint when uncontrolled.

string""
onValueChange

Called with the hint on every change and fix.

(value: string) => void—
kind

A public password hint, or a security-question answer. Changes the copy.

"hint" | "answer""hint"
label

Visible label. Defaults to the kind's label.

string—
minRun

Shortest shared run, in characters, that counts as giving part of the password away.

number4
onLeakChange

Called with the leak (or null) as it changes, so the form can block saving on a whole-password leak.

(leak: HintLeak | null) => void—
delay

Pause in ms before the check runs while typing. Leaving the field runs it at once.

number400
messages

Override any message or label.

Partial<typeof PASSWORD_HINT_MESSAGES>—

* required. Also accepts the native props of <input> (className, aria-*, data-*…), passed through to it.

How is Password Hint Guard accessible?

  • Visible label; input has aria-invalid for a severe leak and is described by a polite status
  • Severe leaks use role=alert
  • Icons are aria-hidden

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

This is a UX guard rail. Enforce on the server: Don't store hints next to passwords, and run the same check on the server if hints are kept.

  • Compares only with the password in the same form
  • Can't catch hints that describe the password indirectly ("my dog's name")
  • English reuse phrases

What expensive mistakes does Password Hint Guard stop?

Password hint reveals the password

Also known as

password hint · security question · recovery · signup · account security · memorable word · password reminder

What dependencies does Password Hint Guard require?

Password Hint Guard facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component namePassword Hint Guard
Registry identifier@bollard/password-hint-guard
Install commandnpx shadcn@latest add @bollard/password-hint-guard
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Password Hint Guard

What form validation mistake does Password Hint Guard catch?

Password Hint Guard prevents password hint reveals the password. Spots the password inside a password hint or security answer, even reversed, spaced out or in leetspeak, without ever showing the password. Catches: The password written in the hint, Reversed, spaced-out or leetspeak versions (P@ssw0rd), A long shared substring of the password, Admissions of reuse such as "same as my bank". Limitation: validate password-hint-guard schemas on backend.

How do I install password-hint-guard with shadcn?

Run `npx shadcn@latest add @bollard/password-hint-guard`. Sources added: registry/default/password-hint-guard/hint-leak.ts, registry/default/password-hint-guard/password-hint-guard.tsx. Package requirements: lucide-react.

What props customize Password Hint Guard?

Password Hint Guard accepts `password`, `value`, `defaultValue`, `onValueChange`, `kind`. Configures password hint, security question, recovery behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of password-hint-guard?

Compares only with the password in the same form. Can't catch hints that describe the password indirectly ("my dog's name"). English reuse phrases Server requirement: Don't store hints next to passwords, and run the same check on the server if hints are kept.

How does Password Hint Guard meet accessibility guidelines?

Visible label; input has aria-invalid for a severe leak and is described by a polite status. Severe leaks use role=alert. Icons are aria-hidden. Minimizes errors: password hint contains password, security question answer weak.

Which components pair with Password Hint Guard?