Prodular UI

Password input

A password field with a show and hide toggle and a Caps Lock hint, plus a strength meter and a requirements checklist for choosing a new password.

npx prodular-ui add password-input

New password

Strength and requirements update as people type. The button waits until every rule is met.

Password strength: Fair
  • At least 12 characters, not met yet
  • Upper and lower case letters, met
  • A number, met
  • A symbol, like ! or #, not met yet

Sign in

Just the field and its toggle. Errors go in the description, not in the field.

The eye shows what you typed. A Caps Lock hint appears while it is on.

That password does not match maya@halcyonlabs.com.

Anatomy

<Field>  <FieldLabel>New password</FieldLabel>  <PasswordInput autoComplete="new-password" value={pw} onChange={(e) => setPw(e.target.value)} />  <PasswordStrength value={pw} /></Field><PasswordRequirements value={pw} />

Guidance

Use it when

  • Every password field. The toggle cuts typos, the Caps Lock hint cuts failed sign ins.
  • PasswordStrength and PasswordRequirements together when people set a new password.

Avoid

  • Strength or requirements on a sign in form. They only make sense when choosing a password.
  • Treating scorePassword as a security check. It is a hint; enforce rules on the server.

Rules for AI agents

Published in llms-full.txt, the registry and the MCP server, so coding agents follow them when they build with this component.

  • Set autoComplete="new-password" on sign up and change password forms, keep the default current-password on sign in.
  • Pass requirements that match the backend's real rules, and disable submit until they are all met.
  • Do not add a second confirm password field; the visibility toggle replaces it.
  • Label the field with Field and FieldLabel. Put server errors in FieldDescription and set aria-invalid on the input.

API

PasswordInput

PropTypeDefaultDescription
defaultVisiblebooleanfalseStart with the password shown.
autoCompletestring"current-password"Use new-password when people choose one.
...propsInput propsvalue, onChange, name, size and the rest pass to the input.

PasswordStrength

PropTypeDefaultDescription
valuestringThe password to score.
score0 | 1 | 2 | 3 | 4Your own estimate, for example from zxcvbn. Overrides the built-in score.

PasswordRequirements

PropTypeDefaultDescription
value / requirementsstring / { id, label, test }[]Rules to tick off. Defaults to length, case, number and symbol.

Installation

The Prodular UI CLI adds the source to components/ui with everything it depends on. In a project that already uses shadcn/ui, the shadcn CLI installs it from the Prodular registry too. See Installation for the first setup.

npx prodular-ui add password-input# or, with the registry in components.jsonnpx shadcn@latest add @prodular/password-input