forever components

Buttons & Toggles

Clay Press Toggle

Three settings rows on a pressed-fibre card, each a real checkbox behind an unfired clay tile: raised fibre when off, pressed pigment with paper tooth and a drawn press mark when on, answering in 90 ms with no spring. A footer counts what is on; the idle demo presses one tile at a time.

csslight complexitysubtle 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

Settings panels, preference lists and consent rows in material or field-science products — anywhere a toggle should feel pressed rather than slid.

When not to

Dense tables of switches, or a single inline on/off in a toolbar.

Working with an AI agent

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

Edit the opts array (label, description, tone: clay / moss / water, initial state) and the demo cadence EVERY=2200; recolour via the pigment tokens and keep --cp16-on for the mark on a pigment fill. 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

  • opts array (label, description, tone, checked)
  • demo cadence (EVERY) and tap duration (90ms)
  • card shape (28px 14px 28px 14px leaf radius) and tile radius (14px)
  • pigments (--cp16-clay, --cp16-moss, --cp16-water) and the fibre / tooth textures
  • theme tokens (:root dark defaults + [data-theme=light] overrides)

Keep intact

  • IIFE wrapper
  • real <input type=checkbox> inside each label (keyboard and screen readers get the native control)
  • every restrictive toggle carries a description; state is never colour alone
  • prefers-reduced-motion guard (instant state changes, no demo)
  • visibilitychange pause
  • theme hook (?theme= bootstrap + forever:theme message listener + theme tokens)

Known limitations

  • Bricolage Grotesque and Noto Sans render only if installed — system sans fallback
  • The demo toggles settings by itself for the wall; remove the clock in a product

togglecheckboxclaypressedbiophilictexturesettingslist

More Buttons & Toggles components

  • Magnetic ButtonDark pill button drifts in an idle orbital float; cursor proximity pulls it magnetically with a label inner-parallax and emerald-to-copper glow on hover.
  • Gooey Liquid TogglePill toggle where an SVG goo-filtered blob stretches and merges as it slides from off to on, shifting grey to magenta. Auto-cycles as demo.
  • Morphing Action FABGradient FAB whose plus icon rotates 135° to an X on click, fanning six icon buttons outward in a staggered radial spring animation. Auto-cycles in demo mode.
  • Material RippleDark rounded button that spawns an expanding ink ripple from the tap point; idles by firing ripples from random positions every 1.5 s.
  • Neon Glow PulseAmber pill button on near-black that breathes a bright neon bloom via opacity pulse on a pseudo-element; hover shifts background and text color.
  • Jelly PressAurora-gradient button squashes and stretches with a spring keyframe animation on click; auto-cycles idle squish every 2.1s to stay alive at rest.