Tumbler Lock OTP
A one-time-code field built from combination-lock drums on real CSS-3D cylinders; each digit whirrs a full turn before landing, a padlock checks the code and springs open — or shakes and spins every drum back on failure.
Try it: Type or paste 246810 to unlock; anything else fails. Esc clears.
Installation
Install with the shadcn CLI:
npx shadcn@latest add https://www.framekitui.live/r/tumbler-lock-otp.jsonOr, with the @framekit namespace registered: npx shadcn@latest add @framekit/tumbler-lock-otp. You can also copy the source into components/ui/tumbler-lock-otp.tsx (view on GitHub).
Usage
import { TumblerLockOtp } from '@/components/ui/tumbler-lock-otp'Props
| Prop | Type | Default | Notes |
|---|---|---|---|
length | number | 6 | Number of drums. |
value / defaultValue / onValueChange | string | — | Controlled or uncontrolled digits. |
onVerify | (code) => boolean | Promise<boolean> | — | Runs when all drums are set; false / reject shows the error state and resets. |
onSuccess | (code) => void | — | Fires after a successful verify. |
label / hint | string | — | Field label and helper text. |
resendAfter / onResend | number / () => void | 30 | Countdown before “Resend code” unlocks (0 hides it). |
disabled / autoFocus | boolean | false | Standard field flags. |
Dependencies
motionlucide-react
Related Inputs / Forms components
- Crystal Strength Password
A password field that grows an SVG crystal: each satisfied rule springs a faceted shard out of the rock, the cluster shifts from ember to glacier, and a perfect score turns it iridescent with…
- Signature Pad Field
An e-signature field: draw with mouse, pen or finger and the ink thins on fast strokes and pools on slow ones; undo stroke by stroke, or switch to the Type tab for a keyboard-friendly script…