Component packs › Latch › Slot OTP
Digits drop into their slots and bounce; paste cascades; a wrong code shakes the row and pops the digits out, a right one closes the gaps so the slots fuse into one pill with a tick.
Slot OTP is an one-time code from Latch, a component pack with 8 components: Form and sign-in components that work like little mechanisms. Price: $2 for the whole pack.
Built with: one real input, SMS autofill, fuse on success.
Code: React and Next.js (TypeScript), Vue 3, plain HTML/CSS/JS, Tailwind CSS v4 and Motion (motion.dev). No npm packages needed. Keyboard accessible, with a reduced-motion version, in dark and light.
| Prop | Type | Default | Description |
|---|---|---|---|
length | number | 6 | Number of digits (4–8). Default 6. |
title | string | ||
hint | string | Line under the title. | |
verify | (code: string) => boolean | Promise<boolean> | accepts 428913 | Check a full code. Return or resolve true when it is right. Default: accepts 428913. |
onComplete | (code: string) => void | Called once the code is verified. | |
theme | 'dark' | 'light' | ||
autoplay | boolean | Showcase mode: types a wrong code, then the right one, until touched. |
readonly value: stringclear(): voiddestroy(): voidimport SlotOtp from './SlotOtp';
<SlotOtp />The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.
Good for: Form and sign-in components.