Pro unlocks unlimited templates48:00:00Get Pro →

Password Input

Password field for login, sign-up, and reset flows. Show / hide, optional strength meter, requirements checklist, copy, and Caps Lock warning — built on InputGroup.

Gallery

Complete create-password card with strength, checklist, and copy.

Loading…

Installation

CLI
npx @sonojs/ui@latest add password-input
Also needs
npx @sonojs/ui@latest add input-group
npm i lucide-react

Usage

password-input.tsx
import { PasswordInput } from "@/components/password-input"

export function Example() {
  return (
    <PasswordInput
      placeholder="Password"
      showStrength
      showRequirements
      autoComplete="new-password"
    />
  )
}

Props

PropTypeDefaultDescription
value / defaultValue / onChangestring / ChangeEvent-Native input value API — works with React Hook Form.
showStrengthbooleanfalseShow the four-level strength meter.
showRequirementsbooleanfalseShow the live requirements checklist.
showCopybooleanfalseShow a copy-to-clipboard button.
showCapsLockWarningbooleantrueWarn when Caps Lock is on while focused.
minLengthnumber8Minimum length for default requirements and strength.
requirementsPasswordRequirement[]defaultsCustom `{ id, label, test }` rules for the checklist.
visible / defaultVisible / onVisibleChangebooleanfalseControl show / hide password visibility.
disabledbooleanfalseDisables the input and addon buttons.
classNamestring-Merge Tailwind classes on the root wrapper.

Related