PasswordInput
Capture password from user with option to toggle visibility
Import
Source
Docs
Package
Usage
Use PasswordInput when you need to capture password from user.
Component provides option to toggle password visibility, if you do not want this feature, use TextInput component with type="password"
.
Password must include at least one letter, number and special character
Radius
xs
sm
md
lg
xl
Size
xs
sm
md
lg
xl
Controlled
Change visibility toggle icon
You can change visibility toggle icon with visibilityToggleIcon
prop.
Pass react component that accepts reveal
and size
props:
Strength meter example
Password strength meter example with Progress and Popover components:
Strong password should include letters in lower and uppercase, at least 1 number, at least 1 special symbol
Focus behavior
You can control focus behavior with toggleTabIndex
.
If prop is 0
then toggle control will be focusable with tab key:
Invalid state and error
Invalid password
Disabled state
In disabled state button to toggle password visibility id not displayed:
With icon
Get input ref
Accessibility
Provide aria-label
in case you use component without label for screen reader support: