∞ forever components

Inputs & Switches

Bristle Slider

A gold handle drags through a field of teal bristles that bend, spring back, and shift gold near the cursor; initial autonomous sweep stops permanently after first input.

canvasmedium complexitymoderate motionpointermobile-ready

Open on the canvas to copy the code → Free account · 3 copies a day · membership goes unlimited

Live demo — the real component, running in a sandbox. One self-contained HTML file, zero dependencies. Open it on the canvas →
1

When to use it

Range inputs or scrubbers needing tactile, organic feel. Hero sections with interactive ambient motion.

When not to

Forms requiring precise value readout — no numeric label is displayed. Low-end mobile where spring physics per frame may stutter.

Working with an AI agent

Every component ships agent-ready metadata. An example instruction for this one:

Change bristle color at rest from teal to deep purple by editing cr/cg/cb base values (56,102,70) to (80,40,140), and increase bristle count density by changing the divisor in Math.round(bw/9) to bw/6. 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

  • bristle density (bw/9 divisor)
  • bristle resting color (cr/cg/cb base values)
  • spring stiffness (k=120) and damping (damp=11)
  • handle/accent color (AC='#ffd23f')
  • bristle reach radius (gap*4.2)
  • autonomous sweep speed (dt*0.9)
  • theme tokens (:root dark defaults + [data-theme=light] overrides)

Keep intact

  • DPR-aware canvas sizing and setTransform
  • visibilitychange stop/start guards
  • reduced-motion static fallback (single resting frame)
  • IIFE wrapper
  • 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
  • Vertical pan and pinch zoom; one pointer owns drag; cancellation restores value; accessible value updates in all motion modes

Known limitations

  • No numeric value readout — not suitable as a production form input without adding a label
  • First deliberate input permanently disables idle demo; manual input, finite feedback and settling remain active. Host demoEnabled=false skips the initial attract cycle.
  • State remains local to each mounted instance; format/theme remount preserves takeover, not component values.

slidercanvasbristlephysicsspringinputgenerative

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.