forever components

Inputs & Switches

Pressure Pad

Teal concentric-ring pad dimples inward and pulses while held; releases with a spring rebound. Live grams-of-force readout updates in real time.

canvasmedium complexitymoderate motionclick

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 →
Worth keeping? Votes steer what gets built next — sign in to cast one, free to read

When to use it

Force/pressure input demos, hardware UI mockups, tactile interaction prototypes, or any UI needing a satisfying press-and-hold affordance.

When not to

Contexts requiring a real pressure sensor — the grams readout is purely simulated. Not suited for light-background UIs (hardcoded dark navy background).

Working with an AI agent

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

Change the accent color from teal to amber by setting AC='#f59e0b', and increase the max simulated force from 840 to 1200 grams by editing the grams calculation on line 99. 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

  • accent color (AC='#34e0d0')
  • max grams readout (depth*840)
  • ring count (n=7)
  • press spring speed (0.16 attack / 0.085 release)
  • pad size ratio (R=Math.min(W,H)*0.34)
  • theme tokens (:root dark defaults + [data-theme=light] overrides)

Keep intact

  • DPR-aware canvas sizing
  • IIFE wrapper
  • prefers-reduced-motion guard with static fallback
  • visibilitychange pause/resume
  • theme hook (?theme= bootstrap + forever:theme message listener + theme tokens)

Known limitations

  • Grams-of-force is purely simulated — no real pressure API
  • Hover crosshair only activates via pointermove over canvas (no keyboard equiv)
  • Background color hardcoded in CSS and JS — must change both to retheme

pressurecanvasui-controlconcentric-ringshapticmonospaceteal

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.