Form
Password input
Published on
Description
The password input masks entered characters for security. Pair with a show/hide toggle button to allow users to verify their input.
Example
Accessibility
- Use explicit
<label for="id">association. - Use
autocomplete="current-password"for login orautocomplete="new-password"for registration. - Show/hide toggle should be a
<button>(not a checkbox) witharia-pressedstate to communicate the toggle state. - Don't disable the input during async operations. Use error messages or status announcements instead.
References
- Under-Engineered Text Boxen (opens in new tab) — Adrian Roselli
- My Priority of Methods for Labeling a Control (opens in new tab) — Adrian Roselli
- Don't Disable Form Controls (opens in new tab) — Adrian Roselli
Related
- WebAuthn — for passwordless authentication
- Text input — for non-sensitive text
Variables
None for input