VisorVisor
ComponentsForm

Password Input

A password input with show/hide toggle and optional strength meter.

Default

With Strength Meter

Sizes

Disabled

Invalid

With Field

Installation

npx visor add password-input

This copies two files into your project:

  • components/ui/password-input/password-input.tsx — the component
  • components/ui/password-input/password-input.module.css — the styles

This also installs the input component as a dependency.

Usage

import { PasswordInput } from '@/components/ui/password-input/password-input';

<PasswordInput placeholder="Enter password" />

API Reference

PasswordInputProps

PropTypeDefaultDescription
showStrengthbooleanfalseShow a password strength meter below the input.
placeholderstringPlaceholder text for the password field.
disabledbooleanfalseDisables the password input.
classNamestringAdditional CSS class names to merge onto the wrapper.
...propsReact.InputHTMLAttributes<HTMLInputElement>All standard HTML input attributes are forwarded.

The component also accepts all standard <input> HTML attributes.

Accessibility

  • The show/hide toggle button has aria-label="Show password" / "Hide password" that updates as state changes
  • The toggle button uses aria-pressed to communicate the current visibility state to screen readers
  • Pair with a <Label> using htmlFor/id for proper labeling
  • When showStrength is enabled, the strength meter is announced via aria-live="polite" as the user types
  • The input renders as type="password" by default; toggling to type="text" reveals the value