forever components

UI Micro-interactions

Copy Confirm

Copy icon morphs to a drawn-stroke checkmark with a green button flash and a "Copied!" toast on click; auto-cycles as a demo loop.

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

Code blocks, CLI command snippets, any copy-to-clipboard button needing clear confirmation feedback.

When not to

Production use without wiring real clipboard API — auto-cycle loop must be removed and navigator.clipboard.writeText added before shipping.

Working with an AI agent

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

Change the code snippet text from 'npm i microfx' to 'npx create-next-app', update the accent color from #1f8f5f to #2563eb, and extend the reset delay from 1400 to 2000ms. 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

  • code snippet text (#code content)
  • accent/done color (#btn.done background, #1f8f5f)
  • button press scale (.85 in animate call)
  • idle demo cadence (FIRST=450 / DEMO_EVERY=3000 / IDLE_BACK=3600 ms)
  • theme tokens (:root dark defaults + [data-theme=light] overrides)

Keep intact

  • busy flag guard (prevents double-fire)
  • stroke-dasharray/dashoffset checkmark draw animation
  • visibilitychange pause/resume
  • reduced-motion guard (no demo interval under reduce)
  • theme hook (?theme= bootstrap + forever:theme message listener + theme tokens)

Known limitations

  • No actual clipboard write — navigator.clipboard.writeText must be added for production use
  • Idle demo cycle runs by default (real input takes over, resumes after a few idle seconds) — remove the demo block for purely on-demand interaction
  • Toast position (bottom 18%) may overlap content on very short viewports

copycheckmarktoastmicrointeractionclickui-controlcode-snippet

More UI Micro-interactions components

  • Add to Cart FlyProduct tile flings a mini clone in a bezier arc into a cart icon on click; badge count bumps with a spring bounce. Auto-cycles as demo.
  • Notification BellSVG bell swings and rings with a ripple wave on click; a red badge counter pops in with a springy bounce and increments each ring. Auto-cycles every 2…
  • Swipe Card StackTinder-style draggable card stack — drag the top card left/right to reveal NOPE/LIKE stamps; fling-away animates it off-screen and cycles to the next card.
  • Pull to RefreshA phone-frame mockup with draggable list rows; pulling down reveals a teal arc spinner that fills and rotates, then triggers a skeleton-row flash on release.
  • Accordion ExpandThree FAQ panels smoothly expand and collapse with a CSS height transition; a chevron rotates 180 degrees to indicate open state. Auto-cycles as demo.
  • Tooltip PopHeart icon button springs a mint-green tooltip above it on hover with a cubic-bezier spring pop; click triggers a subtle press-bounce via Web Animations API.