Sections / Gems / Inputs and forms

Tumblers

A one-time-code input made like a combination lock. Each digit is a brass wheel: type and it spins a turn and clicks into place, backspace spins it back, drag a wheel to roll it by hand. While the code is empty the wheels idle a notch now and then. When every wheel is set the shackle springs open, or, if your check says no, the lock shakes and scrambles. A real input underneath, so paste and one-time-code autofill just work.

Included with Everything
Open the demo
Tumblers: six frames of the gem in motion
Kind
Inputs and forms
Interaction
code input · spinning wheels · drag to roll · paste and autofill · your check via callback · keyboard
Dependencies
None
Licence
Licensed with Full Access, for the sites you build; do not resell the gem itself

Formats

  • Webflow (native)
  • Figma (layers)
  • Framer component
  • HTML
  • Prompts for Claude Code, Cursor, Lovable, v0, Bolt

Copy to Webflow pastes a native section with the gem in an Embed inside it. Copy to Figma pastes a frame of its best moment, text and controls as layers. Copy to Framer pastes a component with its options as controls. HTML is one self-contained snippet. Each prompt (Claude Code, Cursor, Lovable, v0, Bolt) carries the exact files, so your agent installs this gem, not a lookalike. With the MCP server, ask your agent for get_section("tumblers").

Behaviour and accessibility

  • Type, paste or let the phone autofill the code: it goes into a real input with inputmode numeric and autocomplete one-time-code, labelled, and each wheel spins to its digit.
  • Backspace spins a wheel back; the arrow keys roll the last digit up or down; status changes (open, wrong code) are announced politely.
  • Drag a wheel up or down to roll it by hand (mouse, pen or touch).
  • The idle fiddling runs only while the code is empty and the input is not focused; everything stops off screen or in a background tab.
  • With prefers-reduced-motion: wheels jump to their digit, no idling, shaking or springing shackle.

Wire it to your model

Pass `verify(code)` returning true or false (or a promise of either), for example a fetch to your own endpoint that checks the code; without it, any full code opens the lock. `onComplete(code)` is called once it opens.

Options

OptionTypeDefaultWhat
lengthnumber6How many digits.
labelstring"Verification code"Accessible name of the input.
hintstring"Enter the 6-digit code"The line under the lock while the code is incomplete.
donestring"Unlocked"The line once it is open.
wrongstring"That code did not open it"The line when your check says no.
verify(code: string) => boolean | Promise<boolean>Your check: return true (or a promise of true) to open, false to shake and clear. Without one, any full code opens.
onComplete(code: string) => voidCalled with the code once the lock opens.
seednumber3Seed for the idle fiddling and the wheels' starting digits.