Presets

Shine sweep button

A diagonal streak of light glides across the button every few seconds to draw the eye.

CSSTailwindReactGIFMP4
trigger: loop
00.000 / 2.800s
timing
style
content
20 max

npm i motion · the component uses motion/react

How it works

The shine button has a glossy diagonal highlight that passes over it now and then, the effect used on "Get started" and upgrade buttons to catch attention without changing the layout. The highlight is a child element 35% as wide as the button, filled with a gradient that goes from transparent to 60% white and back. The button has position: relative and overflow: hidden so the streak is clipped to its shape.

The sweep keyframe moves the streak from translateX(-150%) to translateX(350%) with skewX(-20deg) applied throughout, which tilts it. The trick is in the timing: the travel happens between 0% and 45%, and from 45% to 100% the streak waits outside the button. With the default 2.8s Duration, you get a roughly 1.3s pass and a 1.5s pause, so the effect reads as an occasional glint instead of a constant shimmer.

The editor exposes Label, Button color, Text color, Corner radius, Duration and Easing. Use it on a single primary action per screen; multiple shining buttons compete. Raise Duration to 5 to 8s for a subtle hero CTA. On light button colors the white streak is faint, so this preset looks best on saturated or dark backgrounds.

The streak has pointer-events: none so it never blocks clicks, and aria-hidden so it is ignored by assistive tech. Only transform is animated. Consider stopping the loop under prefers-reduced-motion, since repeated motion in the periphery is distracting for some readers.

How do I make the shine appear less often?

Increase Duration. The streak only travels during the first 45% of the cycle, so the pause grows along with it. At 6s you get about 2.7s of travel and 3.3s of rest. To keep the pass fast but add a longer pause, edit the keyframe and change 45% to a smaller value like 20%.

Can I trigger the shine only on hover?

Yes. In the copied CSS remove the animation from the default state and add it under the button's :hover selector, with iteration count 1. In Tailwind that becomes a hover:animate-[...] class, and in React you can move the animation into a whileHover variant. A single pass on hover is a nice touch for secondary buttons.

Why is the streak skewed?

A vertical band looks like a scanning bar; tilting it with skewX(-20deg) makes it read as reflected light on a glossy surface. The skew stays the same in every keyframe so only the horizontal position animates. Change the angle in both keyframe steps if you want a steeper or flatter streak.

relatedMore like this

all buttons →
01 Loading button loop
02 Pulse glow button loop
03 3D press button press
04 Border draw button hover
05 Gradient shift button loop

Export

format
height

480p max · small watermark · 3 per day · remove limits