Skip to content
Template Empire
Browse components

Password Criteria

A native password input with live Unicode-defined criteria feedback and no strength score.

  • At least 12 characters: Not met
  • A lowercase letter: Not met
  • An uppercase letter: Not met
  • A number: Not met

Customise

12

Code

<InputPasswordCriteria label="New account password" autoComplete="new-password" />

Input Password Criteria helps a person entering a new password understand which composition requirements are currently met. The checklist responds to the native password field while preserving its form behavior and keyboard editing.

The component reports only explicit rules such as code-point length, Unicode letter case, decimal digits, and optional punctuation or symbols. It does not estimate password strength, check breaches, store values, or replace server-side policy validation.

Install

Add the @te registry to your components.json once:

{
  "registries": {
    "@te": "https://templateempire.io/r/{name}.json"
  }
}

Then install the component:

npx shadcn@latest add @te/input-password-criteria

Usage

import { InputPasswordCriteria } from "@/components/input-password-criteria";

<InputPasswordCriteria
  label="Create a password"
  name="password"
  autoComplete="new-password"
  minLength={14}
  requireSymbol
/>

Props

PropTypeDefaultDescription
labelstringrequiredVisible label associated with the native password input.
valuestringundefinedControlled password value; takes precedence over defaultValue.
defaultValuestringemptyInitial value for uncontrolled use.
onValueChange(value) => voidundefinedReceives the unchanged value from native user input.
minLengthnumber12Required Unicode code-point count; valid range is 1–256.
requireLowercasebooleantrueRequire at least one Unicode Ll code point.
requireUppercasebooleantrueRequire at least one Unicode Lu code point.
requireNumberbooleantrueRequire at least one Unicode Nd decimal digit.
requireSymbolbooleanfalseRequire Unicode punctuation or symbol (P/S); combining marks and controls do not count.
namestringundefinedNative form field name.
autoCompletestringundefinedNative password autofill hint.
classNamestringundefinedAdditional classes merged onto the root.

Customisation

Choose a minimum length and the composition rules used by the surrounding form. The requirements appear as visible text linked to the field. They are UX feedback only; keep authoritative validation on the server and avoid treating the checklist as an entropy or safety score.

<InputPasswordCriteria
  label="New workspace password"
  minLength={16}
  requireSymbol
  autoComplete="new-password"
/>

Frequently asked questions

Does the checklist tell me how secure a password is?
No. It reports only whether the configured local rules are met. It does not calculate entropy, inspect breached-password lists, or make a security-strength claim.
How is length counted?
Minimum length counts Unicode code points, so an astral character counts once rather than as two UTF-16 code units.
Does the component store or send the password?
No. It keeps uncontrolled input state locally or emits the value through onValueChange; it does not persist or transmit it.

Related components

Want the full page this belongs to?Template Empire builds complete Next.js account journeys with considered onboarding and form states. Browse the paid templates that pair with these free components.Explore Template Empire templates