Password Policy Input

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.

StopsHelps catch password rules that weaken accounts

Installation

pnpm dlx shadcn@latest add https://bollard-ui.vercel.app/r/password-policy-input.json

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

Usage

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 it 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

Props

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.

Accessibility

  • 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.

Limitations

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

Rules

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 it stops

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

Dependencies

Pairs well with