Feedback & States
Star Rating
Five SVG stars fill green from a clipped well with spring stagger on hover and commit; shake animation and red flash for denied state, status readout below.
svgmedium complexitymoderate motionpointer
Open on the canvas to copy the code → Free account · 3 copies a day · membership goes unlimited
Worth keeping?
Votes steer what gets built next — sign in to cast one, free to read
When to use it
Review forms, product ratings, feedback widgets needing tactile feel with success/error state communication.
When not to
Read-only display contexts or anywhere the auto-demo loop would conflict with real user state — remove the SEQ demo timer before shipping.
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Change accent color from green to amber by setting --fb11-ac to #f59e0b and --fb11-ac2 to #d97706, and increase star count N to 10. 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
- star count (N=5)
- accent color (--fb11-ac, --fb11-ac2)
- error color (--fb11-err)
- spring stagger step (STEP=0.07)
- demo sequence timings (SEQ[].t values)
- idle timeout before demo resumes (3200ms)
- theme tokens (:root dark defaults + [data-theme=light] overrides)
Keep intact
- SVG clipPath per star (critical for fill-from-bottom illusion)
- IIFE wrapper
- prefers-reduced-motion guard with static fallback
- visibilitychange pause
- aria-valuenow updates + role=slider
- theme hook (?theme= bootstrap + forever:theme message listener + theme tokens)
Known limitations
- Auto-demo loop restarts after 3.2s idle — must be removed for production use
- deny() is wired to Enter/Space key in demo but has no real trigger condition to customize
- Star count change requires updating N only; aria-valuemax must also be updated manually
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.
- Toast StackDark notification toasts spring up from the bottom, drain a colored progress bar, then slide off right. Four types cycle: success, error, warning,…
- 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.