Form input

OTP input

Paste, autofill, edit, and group a code without multi-input focus traps.

Semantics and name

Assistive technology meets one labelled field.

  • One field

    The input carries the name, `aria-invalid` and `aria-describedby`; the cells are hidden from the accessibility tree.

  • Input hints

    `inputmode` follows `mode`, so digits open a numeric keypad, and `autocomplete="one-time-code"` lets the platform offer the code it received.

Keyboard and focus

It edits like a text field, because it is one.

  • Editing

    Typing fills the next cell, Backspace removes the character before the caret, and ArrowLeft and ArrowRight move the caret between cells.

  • Paste and autofill

    A pasted code is normalised — full-width and non-Latin digits become ASCII — and characters outside the alphabet are dropped and reported through `invalid`.