Glare hover
Also called shine hover effect, light sweep, or sheen effect
A diagonal band of light that sweeps once across a card or button when the pointer enters it, like light glancing off glass or a glossy print.
import { useState, type ReactNode } from 'react';
import { motion, useReducedMotion } from 'motion/react';
export function GlareButton({ children }: { children: ReactNode }) {
// A new key on every entry restarts the sweep, so it plays once per hover
// and never runs backward when the pointer leaves.
const [sweep, setSweep] = useState(0);
const reduceMotion = useReducedMotion();
const replay = () => setSweep((count) => count + 1);
return (
<button
type='button'
onPointerEnter={(event) => {
if (event.pointerType === 'mouse') replay();
}}
onFocus={replay}
className='relative isolate overflow-hidden rounded-full bg-blue-600 px-6 py-3 text-sm font-semibold text-white'
>
{children}
{sweep > 0 ? (
<motion.span
key={sweep}
aria-hidden
className='pointer-events-none absolute -inset-y-1/2 left-0 w-2/5 bg-linear-to-r from-transparent via-white/55 to-transparent'
// Motion writes translateX before rotate, so the band slides
// straight across while staying tilted.
style={{ rotate: 20 }}
// Just past one edge to just past the other, for a pill this shape.
initial={reduceMotion ? { x: '75%', opacity: 0 } : { x: '-130%' }}
animate={reduceMotion ? { opacity: [0, 0.6, 0] } : { x: '280%' }}
transition={{ duration: 0.75, ease: 'easeInOut' }}
/>
) : null}
</button>
);
}Add a glare hover to the pass card and the "Get your pass" button: inside each, absolutely position a band 40% of the element’s width and twice its height, rotated 20 degrees, filled with a linear-gradient from transparent to white at 55% in the middle and back to transparent. On pointer enter and on keyboard focus, slide it from just past the left edge to just past the right edge over 750ms with ease-in-out, once per hover and without reversing on leave. Clip it to the element’s rounded corners, and fade a still highlight in and out instead when prefers-reduced-motion is set.
Paste into Layerwise or any AI coding tool.
What is Glare hover?
A glare hover places a narrow, tilted gradient (transparent, then white, then transparent) inside an element and clips it with overflow: hidden. When the pointer enters, the band slides from one side to the other with a transform, so a streak of light crosses the surface once. It suits glossy things: tickets, gift and membership cards, album art, product tiles, and primary buttons.
Play the sweep once per hover, and let it run all the way across even if the pointer leaves early, without reversing. Size the band and its travel to the element, so the whole duration is spent crossing it: around 600 to 900ms with an ease-in-out curve reads as a glint, and much faster looks like a flicker. A soft white gradient with a brighter core shows up on any surface. Blend modes such as overlay tint the band with the colors underneath, but it nearly disappears over dark areas.
Make the band pointer-events: none and aria-hidden. Play it on keyboard focus too, skip it on touch screens, and replace the moving band with a brief, still highlight for people who prefer reduced motion.
Often confused with
- 3D tilt card
- A tilt card rotates in 3D toward the pointer, and its glare follows the pointer. A glare hover keeps the element flat and sweeps one band across it.
- Shimmer text
- Shimmer text loops a band of light across a label to show that work is in progress. A glare hover plays once, in answer to the pointer.
Related terms
All termsHover effect
A visual change, such as a lift, glow, or zoom, that happens when the mouse pointer moves over an element to show it can be clicked.
3D tilt card
A card that tips in 3D as the mouse moves over it, often with a moving glare, so it feels like a physical object in your hand.
Shimmer text
Text with a band of light sweeping across it on a loop, often used for "Thinking…" and other status labels while an app is working.
Spotlight card
A card whose border and background light up with a soft radial glow that follows the mouse pointer, often across a whole grid of cards.
Build it with Layerwise
Describe your app, watch it run in a live preview, and publish it with a database, storage, and sign-in built in.
