- At least 8 characters
- One uppercase letter
- One number
- One symbol
Installation
$ pnpm dlx shadcn@latest add @synccn/password-inputFirst time in this project? Connect synccn with one command.
Usage
import { PasswordInput } from "@/components/ui/password-input";<PasswordInput />API reference
Generated from the component's TypeScript types, so it always matches the code.
PasswordInput
Password field with show/hide, a strength meter and a rules checklist.
PropTypeDescription
- showStrength
booleanDefault
trueShow the meter and rules checklist.
- rules
PasswordRule[]Default
RULESChecks shown in the list; strength is the number passed.
- className
stringExtra classes for the root element.
Also accepts every standard <input> attribute, and forwards its ref.
Dependencies
Read from the component's imports when the site builds. The CLI installs all of these for you.
Helpers
- lib/utilscn (merges class names)
npm packages
- clsx for cn()
- tailwind-merge for cn()
- lucide-react for Check, Eye, EyeOff, X
Accessibility
From the source
Read from this component's code when the site builds, so it can't drift.
- ARIA attributes: aria-describedby, aria-label, aria-live
- Shows a visible focus ring for keyboard users
- Announces changes to screen readers
More inputs
ButtonSeven variants, four sizes and a built-in loading state.InputText field with optional leading icon and invalid state.TextareaMulti-line field that grows with its content and counts characters.CheckboxChecked, unchecked and indeterminate, with label and description.SwitchToggle with a springy thumb in three sizes.Radio GroupPick one option, shown as dots or as selectable cards.