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.json

Or, 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

Component props
PropTypeDefaultNotes
lengthnumber6Number of drums.
value / defaultValue / onValueChangestring—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 / hintstring—Field label and helper text.
resendAfter / onResendnumber / () => void30Countdown before “Resend code” unlocks (0 hides it).
disabled / autoFocusbooleanfalseStandard field flags.

Dependencies

  • motion
  • lucide-react
  • 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…

See all 3 Inputs / Forms components