Input PIN

One-time-code / PIN entry across separate digit cells. Typing auto-advances, Backspace steps back, arrows navigate, and pasting a code distributes its digits across the cells.

Install

Examples

4 digits

length sets the number of cells (default 4).

6 digits

Sizes

Two sizes — l (default) and xl.

Negative

Positive

Disabled

Guidelines

Usage

verification codes, 2FA, and short PIN entry. Form-associated — the host submits the joined value and fires a complete event when every cell is filled. For general text, use Input.

Do

  • Match length to the real code length so paste fills cleanly.
  • Tell users where the code came from in help-text.
  • Use state="negative" with a message when a code is wrong.

Don’t

  • Don’t use split cells for long or alphanumeric input — use Input.
  • Don’t block paste; many users paste codes from another app.
  • Don’t rely on colour alone for the error — keep the help text.

Accessibility

Properties

Related