HTML & CSS for a One-Time Password Input
Briefly

The article discusses the usability challenges associated with One Time Password (OTP) input fields, which typically require users to fill in individual text boxes for each digit. Brad Frost highlights issues like pasting difficulties, confusion over including dashes, and the overall user experience being overly complicated. The author draws from Phuoc Nguyen's article which emphasizes better user interaction design, such as allowing arrow key navigation and handling paste functions. Ultimately, the author questions the necessity of separate inputs, suggesting that a single input field could simplify the interaction without compromising design aesthetics.
I don't like the pattern where each digit is its own text box. It's an affordance that's supposed to make things clearer, but it doesn't (for me at least). Can I paste?
That's a lot of JavaScript code. Why is this so hard? And what would happen without JavaScript? Seems like it would be a pretty gnarly experience.
The rectangles behind the numbers is just visual theater. Just a bit of trendy decoration. It's just a styling concern, not a semantic, usability, or any other concern.
A particular thing that makes it hard is making each character a separate <input /> in the HTML. That complicates validation, input, pasting, accessibility, navigation... literally everything.
Read at Frontendmasters
[
|
]