Code Slots

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/input-code-slots

About this component

A one-time code field drawn as six cells. Digits roll up into their cell and a caret blinks in the next one; when the sixth lands, the cells slide together into one pill and a tick pops beside it. One real input underneath, so paste and SMS autofill just work.

Triggers

  • Focus
  • State change
  • Delay stagger
  • Spring

Techniques

  • Keyframes
  • CSS transition
  • Pseudo elements
  • State machine

Difficulty

Intermediate

Accessibility

Keyboard and screen readers

One real input (inputmode numeric, autocomplete one-time-code) inside a <label>, so it is named "Verification code" and paste and SMS autofill work. The drawn cells are aria-hidden; a polite live region says "Code complete".

Reduced motion

Nothing animates.

Use it in anything you build, commercial and client work included. Licence

More inputs

See all
Did the build pass?
All green. Shipping now
ComposerGet code
Drop LettersGet code
Ghost CompleteGet code

Handle CheckGet code