Password Visibility Toggle
The eye icon inside a password field that reveals the characters instead of dots.
<input type="password"> + toggle buttonWhen to use it
On every password field, especially on mobile.
Common mistake
Don’t block paste in password fields.
Accessibility
Label the button (Show password) and reflect state with aria-pressed.
Name in code
| HTML/CSS | <input type="password"> + toggle button |
|---|---|
| React | <PasswordInput> |
| Jetpack Compose | PasswordVisualTransformation + IconButton |
| SwiftUI | SecureField / TextField swap |
Ready prompt for your coding agent
Add a Password Visibility Toggle to this screen.
What it is: The eye icon inside a password field that reveals the characters instead of dots.
Implement with: <input type="password"> + toggle button (HTML/CSS).
Accessibility: Label the button (Show password) and reflect state with aria-pressed.
When to use it: On every password field, especially on mobile.
Avoid: Don’t block paste in password fields.
Reuse the project's existing design tokens, spacing and component conventions.
Or compose a whole page from this element and others →
Prompts are in English for the most precise results with coding agents.