Input
Password Input
NewA password field with a show and hide toggle, a four-step strength bar and rules that tick off as you type.
npx motionsnack add password-inputCustomize
Error Colour
Warning Colour
Success Colour
<PasswordInput />Props
28 properties
| Property | Type | Default | Description |
|---|---|---|---|
| value | string | - | Controlled value. Leave undefined to let the component manage it. |
| defaultValue | string | '' | Value on first render when uncontrolled. |
| onChange | (value: string) => void | - | Called with the new text on every change. |
| name | string | - | Name submitted with a form. |
| mode | 'current' | 'new' | - | Sign-in or new password: sets autocomplete and whether the meter and rules show. |
| invalid | boolean | false | Invalid without its own message. |
| weakColor / fairColor / strongColor | string | - | Deprecated aliases of errorColor / warningColor / successColor. |
| id | string | generated | Id of the input. |
| className | string | '' | Extra classes on the wrapper. |
| label | string | 'Password' | Label above the field. Empty hides it. |
| placeholder | string | 'Create a password' | Hint inside the empty field. |
| autoComplete | 'new-password' | 'current-password' | 'new-password' | new-password for sign-up forms, current-password for sign-in. |
| showStrength | boolean | true | Show the strength bar under the field. Off by default in current mode. |
| showRules | boolean | true | Show the rules that tick off as the password meets them. |
| minLength | number | 8 | Fewest characters a password needs. |
| strengthLabels | string | 'Weak, Fair, Good, Strong' | Words of the four strength levels, weakest first, separated by commas. |
| ruleLabels | string | 'At least {n} characters, A number, An upper case letter, A symbol' | Rule texts separated by commas: length ({n} = the number), number, upper case, symbol. |
| toggleLabel | string | 'Show password' | Label of the show / hide button for screen readers. |
| helperText | string | '' | Small text under the field. Empty hides it. |
| capsLockLabel | string | 'Caps Lock is on.' | Hint shown while Caps Lock is on. |
| error | string | '' | Error message. Any text switches the field to its error state. |
| disabled | boolean | false | Disables the field. |
| required | boolean | false | Marks the field as required. |
| errorColor | string | '' | Weak bar and error message, both themes. Empty uses the per-theme pair. |
| warningColor | string | '' | Fair bar, both themes. Empty uses the per-theme pair. |
| successColor | string | '' | Good / strong bar and met rules, both themes. Empty uses the per-theme pair. |
| height | number | 48 | Height of the field. |
| radius | number | 12 | Corner radius of the field. |
About Password Input
Password Input is made for sign-up and account forms. The eye button shows or hides the password, and a slash draws across the eye while it is hidden. Under the field a strength bar fills segment by segment and changes colour from weak to strong, and a list of rules ticks off one by one with a drawn check mark: length, a number, upper and lower case, a symbol. Every word is a prop, so the field can be translated, and the bar and rules can be switched off for a sign-in form.
What's included
- Show and hide toggle with a drawn slash
- Four-step strength bar with three colours
- Rules that tick off with a drawn check
- Minimum length and every text as props
- Sign-up or sign-in autocomplete
- Light and dark look
- Type
- Animated React input component
- Library
- Components · Input
- Stack
- Next.js, React, Tailwind CSS
- Added
- 2026-11-23
- Install
npx motionsnack add password-input