Form
One time code input
Published on
Description
The one-time code input provides a text field for entering verification codes sent via SMS or email. It uses autocomplete="one-time-code" to enable automatic code detection and autofill.
Example
Accessibility
- Use explicit
<label for="id">association. - Use
autocomplete="one-time-code"to enable SMS autofill on supported devices. - Use
inputmode="numeric"to show a numeric keyboard on mobile. - Inherit typography for WCAG 1.4.12 compliance.
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
Related
- Text input — for general text
- Password input — often used together in authentication flows
Variables
None for input