Shine
A subtle diagonal specular sweep for drawing attention to interactive
surfaces. Unlike a skeleton shimmer, Shine runs as an occasional flick
with rest between passes - one quick highlight every few seconds - so it
reads as "this surface is alive" rather than "content is loading".
Pass playOnce for a single entrance sweep (then it fades out).
Two usage shapes:
1. Wrapper - pass children and Shine wraps them in a relative box.
2. Overlay - render without children inside an existing relative parent.
Uses mix-blend-mode: soft-light so the highlight harmonizes with the
underlying colour instead of painting pure white.
Honours prefers-reduced-motion - renders nothing when motion is reduced
(a static band would read as a permanent artefact, not a cue). When
visible flips to false, the sweep fades out then unmounts so its rAF
loop stops.
Usage
Best practices
Use
Shinefor a periodic "this surface is alive" flick on an interactive element - not for loading; a continuous text sweep isShimmerand a content placeholder isSkeleton.Use
playOncefor entrance choreography that should not loop.Either pass
children(Shine wraps them in a relative box) or render it bare inside an existingposition: relativeparent - otherwise the sweep has nothing to overlay.Needs
ReducedMotionProvider; under reduced motion it renders nothing (a static band would look like a permanent artefact), so don't rely on it as persistent decoration.
Props
Also exports
- interface
ShineProps
Composition
Builds on