Password Input
ProNewA password field with a show and hide button, a Caps Lock warning and an optional four-step strength meter.
Installation
pnpm dlx shadcn@latest add @viewport/password-input
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
The code behind the preview above comes with Truffle Pro.
Props
| Prop | Type | Default |
|---|---|---|
| strength | booleanShow a four-step strength meter under the field. | false |
| strengthLabels | [string, string, string, string]The words for the four strength levels, weakest first. | ["Weak", "Fair", "Good", "Strong"] |
Accessibility
- The toggle is a button with aria-pressed.
- Strength is announced as a word when the level changes.
- Works with password managers through `autoComplete`.
- Respects prefers-reduced-motion.