Introducing PrimeReact v11-alpha 🎉Discover Now

Password

Password is an enhanced input for password entry with strength metering, mask toggling, and controlled or uncontrolled usage.

Create a password
8+ characters
Number
Uppercase letter
Special character
preview

Usage#

import { Password } from '@/components/ui/password';
<Password />

Examples#

Basic#

A password input with strength indicator and toggle visibility.

basic-demo

Toggle Mask#

Adding a toggle icon to show or hide the password, allowing users to verify their input.

toggle-mask-demo

Requirements#

Display a checklist of password requirements that update in real-time as the user types, providing clear feedback on which criteria have been met.

  • At least 12 characters
  • Contains uppercase letter
  • Contains lowercase letter
  • Contains number
  • Contains special character
requirements-demo

Strength Meter#

Visualize the overall password strength with an animated progress bar and a severity-based label that adapts as the password improves.

strength-demo

Popover#

Combine a visibility toggle, strength meter, and requirements checklist into a fully custom password creation with Popover component.

popover-demo

Clear Icon#

Use a custom clear action to reset the password input.

clear-icon-demo

Sizes#

Password provides small and large sizes as alternatives to the base.

sizes-demo

Fluid#

The fluid prop makes the component take up the full width of its container when set to true.

fluid-demo

Filled#

Specify the variant property as filled to display the component with a higher visual emphasis than the default outlined style.

filled-demo

Disabled#

Use the disabled property to disable a password input.

disabled-demo

Invalid#

Specify the invalid property to display the component with a red border.

invalid-demo

API#

Sub-Components#

See Primitive API for PasswordRoot component documentation.

Hooks#

See Headless API for usePassword hook documentation.

Accessibility#

See Password Primitive for WAI-ARIA compliance details and keyboard support.