Inputs & Switches
OTP Boxes
Four native numeric OTP inputs support typing, paste, focus advance and Backspace navigation. Initial digits are populated; first input stops scripted entry.
csslight complexitymoderate motionclickmobile-ready
Open on the canvas to copy the code → Free account · 3 copies a day · membership goes unlimited
1
When to use it
Authentication UI demos, login flow mockups, verification code input previews.
When not to
A complete verification flow requiring server validation, expiry or delivery; this tile models local numeric entry only.
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Change the generated native input count and every navigation boundary together for a longer OTP. Adjust --c08-accent tokens and the guarded demo entry cadence. Keep numeric filtering, paste distribution, focus advance, Backspace handling and reduced-motion input response. Theme uses :root and [data-theme="light"] tokens with the forever:theme message hook.
Safe to edit
- native digit count (generation loop i<4 and navigation boundaries i<3)
- initial digits array [2,8,4,7]
- demo digit entry cadence while demoEnabled
- cell dimensions and gap
- theme tokens (:root defaults and [data-theme=light] overrides)
Keep intact
- IIFE wrapper
- prefers-reduced-motion guard (static fill fallback)
- visibilitychange pause guard
- theme hook (?theme= bootstrap + forever:theme message listener + theme tokens)
- demo-v1 preview lifecycle: initialize demoEnabled from window.__foreverPreview and stop attract work on the window forever:interactive event; retain manual feedback, settling, cleanup and explicit sessions
Known limitations
- Four local numeric inputs have focus and paste handling; no server validation or verification request is connected.
- State remains local to each mounted instance; format/theme remount preserves takeover, not component values.
More Inputs & Switches components
- Liquid ToggleSVG liquid toggle with a goo filter, trailing droplets and a native button. First deliberate input stops the idle demo; the chosen on/off state settles fully.
- Glow SliderSVG range slider with a muted plum-to-teal fill, glow and value bubble, driven by a native range input. First input stops demo oscillation; drag and…
- Spring StepperMint stepper with native minus/plus buttons and a number reel that settles with spring feedback. First deliberate input stops automatic steps; the chosen…
- Segmented ControlSlate-to-sage pill slides between four native segment buttons with elastic spring stretch. First input stops automatic cycling; committed selection remains.
- Checkbox MorphThree native amber checkbox buttons animate their check strokes and expose pressed state. First input stops the demo; checked values remain.
- Star RatingFive gold SVG star radio controls commit ratings on click or keyboard input and settle with a scale bounce. First input stops automatic sweeping.