Password Policy Input

Password Policy Input is a copy-paste React component that stops helps catch password rules that weaken accounts 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-policy-input
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

StopsHelps catch password rules that weaken accounts

Was this component page useful?

How do I install Password Policy Input?

pnpm dlx shadcn@latest add @bollard/password-policy-input

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

How do I use Password Policy Input in React?

password-policy-input-usage.tsx
import { PasswordPolicyInput } from "@/components/ui/password-policy-input"

<PasswordPolicyInput
  // A typical inherited enterprise policy: every rule NIST SP 800-63B-4 now advises against.
  defaultValue={{
    minLength: 8, maxLength: 16, requireUppercase: true, requireLowercase: true, requireDigit: true, requireSymbol: true,
    expiryDays: 90, allowPaste: false, breachCheck: false, securityQuestions: true, passwordHints: false, mfaRequired: false, maxFailedAttempts: 0,
  }}
  onSave={() => new Promise((resolve) => setTimeout(resolve, 600))}
/>

What input mistakes does Password Policy Input catch?

  • Composition rules (mixtures of character types), which NIST says SHALL NOT be imposed
  • Forced periodic rotation
  • Security questions and password hints
  • Minimum under 15 (or 8 when only used with MFA), maximum under 64
  • Paste blocked, no breached-password check, no failed-attempt limit
  • What the rules accept and refuse, shown on sample passwords

What props does Password Policy Input accept?

PasswordPolicyInput props
PropTypeDefault
value

Controlled policy.

Partial<PasswordPolicy>—
defaultValue

Initial policy when uncontrolled. Missing fields take NIST defaults.

Partial<PasswordPolicy>—
onValueChange

Called with the full, cleaned policy on every change.

(policy: PasswordPolicy) => void—
samples

Passwords to run through the rules, to show the effect on real behaviour.

string[]DEFAULT_SAMPLES
onSave

Save the rules. May return a Promise; edits made while it runs keep the form unsaved.

(policy: PasswordPolicy) => void | Promise<void>—
messages

Any visible string.

Partial<Omit<PasswordPolicyMessages, "findings" | "reasons">> & { findings?: Partial<PasswordPolicyMessages["findings"]>; reasons?: Parti…—

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

How is Password Policy Input accessible?

  • Every policy input has a visible label, aria-invalid on SHALL findings and a description
  • Fix buttons are real buttons; focus moves to the summary after applying defaults
  • 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: Enforce length, blocklist and attempt limits in your authentication service.

  • Covers the password sections of the standard, not the whole of SP 800-63B
  • Doesn't enforce anything; your auth system applies the policy
  • Informational; check the official source

What validation rules apply to Password Policy Input?

Rules last verified:

Informational; check the official source. Confirmed: minimum 15 for single-factor, 8 when only used with MFA; SHOULD permit at least 64; SHALL NOT impose composition rules, periodic change, hints or KBA; SHOULD permit paste. Copied components don't update themselves, so re-check after rule changes (see updating a component).

What expensive mistakes does Password Policy Input stop?

Helps catch password rules that weaken accounts

Also known as

password policy · nist 800-63b · admin settings · security settings · mfa · breached passwords · password rules · auth config

What dependencies does Password Policy Input require?

Password Policy Input facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component namePassword Policy Input
Registry identifier@bollard/password-policy-input
Install commandnpx shadcn@latest add @bollard/password-policy-input
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 Policy Input

What form validation mistake does Password Policy Input catch?

Password Policy Input prevents helps catch password rules that weaken accounts. Reads an admin's password rules back against NIST SP 800-63B-4 and shows what they do to real passwords, so the rules don't make accounts weaker. Catches: Composition rules (mixtures of character types), which NIST says SHALL NOT be imposed, Forced periodic rotation, Security questions and password hints, Minimum under 15 (or 8 when only used with MFA), maximum under 64, Paste blocked, no breached-password check, no failed-attempt limit, What the rules accept and refuse, shown on sample passwords. Limitation: validate password-policy-input schemas on backend.

How do I install password-policy-input with shadcn?

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

What props customize Password Policy Input?

Password Policy Input accepts `value`, `defaultValue`, `onValueChange`, `samples`, `onSave`. Configures password policy, nist 800-63b, admin settings behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of password-policy-input?

Covers the password sections of the standard, not the whole of SP 800-63B. Doesn't enforce anything; your auth system applies the policy. Informational; check the official source Server requirement: Enforce length, blocklist and attempt limits in your authentication service.

How does Password Policy Input meet accessibility guidelines?

Every policy input has a visible label, aria-invalid on SHALL findings and a description. Fix buttons are real buttons; focus moves to the summary after applying defaults. Icons are aria-hidden. Minimizes errors: password complexity rules bad, forced password rotation.

Which components pair with Password Policy Input?