StealThis .dev

Banking — OTP / 2FA Input

A trust-first six-digit OTP and two-factor verification screen for banking and fintech flows. Boxes auto-advance as you type, accept a full pasted code, and support an optional masked mode for shoulder-surfing safety. A resend countdown timer throttles new codes, while clear error and success states confirm whether the entered code matches. Includes an encrypted badge, accessible inputs, keyboard navigation, tabular figures, and a responsive layout that holds together down to small mobile widths.

Open in Lab
html css vanilla-js
Targets: JS HTML

Code

OTP / 2FA Input

A focused verification screen for confirming a sensitive banking action, styled with a calm navy-and-trust-blue palette. Six single-character boxes form the one-time passcode field: typing a digit advances the caret to the next box, Backspace steps backward and clears, and the arrow keys move between positions. Pasting a code from an SMS or authenticator app fills every box at once and triggers validation automatically.

A “Mask digits” toggle swaps the entered characters for dots so the code can’t be read over your shoulder, and a resend control stays disabled behind a 30-second countdown to discourage rapid retries. When you submit, the screen shows a brief loading state, then resolves into either a red error state — with a shake animation and a cleared field — or a green verified state confirming the transfer.

Everything runs on vanilla JavaScript with a small toast() helper, accessible aria-live status messaging, tabular figures for the code, WCAG-AA contrast, and a responsive layout tuned for narrow mobile screens. The demo code is 481902.

Illustrative UI only — not real banking software or financial advice.