shimmer-button
A highlight that sweeps across a CTA. Part of
motion-anything; obeys MOTION-SPEC.md. Technique
popularized by Magic UI, reimplemented dependency-free (pure CSS).
When to use it
- One primary call-to-action you want to feel premium ("Get started" / "Upgrade").
When NOT to use it (restraint)
- Secondary / destructive buttons; many buttons at once (the sweep becomes noise). One per view.
How to apply
- Copy
shimmer-button.cssinto the project and link it. - Mark the button:
<button class="shimmer">Get started</button> - Tune the sweep duration (default 2.6s at rest, 1.1s on hover) and the button colors as needed.
Accessibility & performance
- Under
prefers-reduced-motionthe sweep stops; a plain solid button remains. - Animates the
transformof a masked pseudo-element only — GPU-safe.
Framework notes
- Pure CSS; works in any framework.