forever components

Feedback & States

Toast Stack

Dark notification toasts spring up from the bottom, drain a colored progress bar, then slide off right. Four types cycle: success, error, warning, empty-state.

cssmedium 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

Demo pages, design system showcases, or any context needing an animated notification pattern reference. Tap/click to push toasts manually.

When not to

Production toast systems — auto-cycles by default and lacks accessible live-region announcements. Needs refactoring before shipping.

Working with an AI agent

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

Change LIFE from 3200 to 5000 to slow auto-dismiss, set MAX to 4, and change the success color from #34d399 to #60a5fa. 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

  • toast lifetime (LIFE = 3200ms)
  • max visible toasts (MAX = 3)
  • toast kind definitions (KIND array — title, subtitle, color class)
  • enter/exit durations (ENTER = 460, EXIT = 320)
  • CSS color tokens (--ok, --err, --warn, --mut)
  • theme tokens (:root dark defaults + [data-theme=light] overrides)

Keep intact

  • IIFE wrapper
  • reduced-motion static fallback (3-toast snapshot)
  • visibilitychange stop/start guard
  • spring() function — drives entrance overshoot
  • theme hook (?theme= bootstrap + forever:theme message listener + theme tokens)

Known limitations

  • No aria-live region — screen readers won't announce new toasts without adding role=status/alert
  • Auto-cycles via setTimeout; must remove tick() loop for production use
  • Progress bar driven by rAF, not CSS animation — adds frame budget cost

toastnotificationstackprogress-barspringfeedbackui-pattern

More Feedback & States components

  • Success CheckMint-green ring sweeps closed and a checkmark draws in with a springy pop and expanding halo; auto-replays and responds to click or spacebar.
  • Error ShakeDark email input shakes horizontally with decaying-sine, border flushes red, X icon pops in with overshoot spring, validation message slides up.
  • Slide to ConfirmDraggable pill slider fills green on full slide; early release triggers a red shake. Spring physics snap thumb back. Auto-demos with an occasional failure…
  • Hold to ConfirmPress-and-hold fills a tick-marked ring; full hold rotates center square 45° into a green check; early release flashes red cross (cancelled).
  • Empty StateA Bauhaus open vessel sits empty while 26 mint motes drift in a slow orbital cloud above it; poking scatters them and they spring back to settle.
  • Like BurstHeart dips then spring-pops into a magenta-mint gradient, firing a 96-particle synthwave burst of dots and ring shards. Auto-cycles when idle.