Adventureland Registry

Shine Animation

A Framer Motion wrapper that sweeps a white glare overlay across any child content when the triggered prop flips to true.

ShineAnimation is a composable wrapper that adds a one-shot horizontal shine sweep to any child element. Pass triggered={true} to play the animation; it resets automatically once the transition completes. An optional delay lets you sequence multiple instances.

Installation

npx shadcn@latest add @adv/shine-animation

Usage

import ShineAnimation from '@/components/shine-animation';

<ShineAnimation triggered>
  <img src="/hero.png" alt="Hero" />
</ShineAnimation>

Example

Shine me

Props

PropTypeDefaultDescription
childrenReactNodeContent to wrap with the shine overlay.
delaynumber0Delay in milliseconds before the animation starts after triggered becomes true.
durationnumber0.8Duration of the shine sweep in seconds.
classNamestring""Additional CSS classes on the outer wrapper div.
triggeredbooleanfalseSet to true to fire the animation. Automatically resets when complete.

On this page