Inputs & Switches
OTP Boxes
Four teal monospace OTP cells auto-fill digits with a slide-up bounce and blinking caret; sequence clears and loops. Dark background with glow on active cell.
csslight complexitymoderate motion
Open on the canvas to copy the code → Free account · 3 copies a day · membership goes unlimited
Worth keeping?
Votes steer what gets built next — sign in to cast one, free to read
When to use it
Authentication UI demos, login flow mockups, verification code input previews.
When not to
Actual interactive OTP input — this is display-only with no keyboard handling or real input events.
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Change cell count to 6 (set N=6), switch accent color from #3ff0c0 to #a78bfa, and slow the fill interval by changing the timer threshold from 34 to 50. Theme: dark tokens live in :root, the light variant in :root[data-theme="light"]; ?theme=light or a {type:'forever:theme'} postMessage switches at runtime.
Safe to edit
- digit count (N=4)
- accent/caret color (#3ff0c0)
- fill interval timer threshold (34)
- cell width/height (46px/60px)
- bounce easing (cubic-bezier(.2,1.4,.4,1))
- pause between fill and clear (timer>60)
- theme tokens (:root dark defaults + [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)
Known limitations
- Not an interactive input — no keyboard events or focus management; wire real inputs before shipping
- Cell count is JS-only (N constant); CSS gap and sizing not auto-scaled for larger N
More Inputs & Switches components
- Liquid ToggleSVG toggle with a goo filter — the knob slides with trailing liquid droplets; track color fades between off and on states.
- Glow SliderSVG range slider with a plum-to-teal gradient fill, glowing knob, and a floating value bubble that tracks the handle; auto-oscillates when idle.
- Spring StepperMint-themed +/- stepper with a number reel that springs and overshoots between digits 0–9; auto-cycles as a demo. Dark green palette.
- Segmented ControlSlate-to-sage gradient pill slides between Day/Week/Month/Year segments with elastic spring stretch. Auto-cycles; click pauses briefly.
- Checkbox MorphThree amber rounded checkboxes auto-cycle and respond to clicks; the box fills and a checkmark strokes in via animated dashoffset.
- Star RatingFive gold stars auto-sweep ratings up and down; the active star pops with a scale bounce. Pointer sets the hover rating instantly.