Shine

A highlight that sweeps across a surface on hover or click.

shine.tsx

Installation

1

Install the packages

npm install @prequelui/react motion

@prequelui/react reuses the primitive library your components already depend on.

2

Add the component

npx shadcn@latest add https://animate.prequelui.terravidhal.me/r/shine.json

npx shadcn@latest add https://animate.prequelui.terravidhal.me/r/shine.json

3

Turn on the motion

npx @prequelui/cli@latest animate shine

The CLI finds the component through components.json, swaps the import and removes the CSS animation classes that Motion replaces.

Usage

Import the component and compose it exactly like the primitive it wraps. Motion is enabled by default; the tempo prop scales every duration and softens every spring.

shine.tsx
import { Shine } from "@/components/prequelui/effects/shine";

export default function Demo() {
  return (
    <Shine enableOnHover loop loopDelay={450} className="rounded-xl border px-5 py-3">
      Hover for a shine
    </Shine>
  );
}
import { Shine } from "@/components/prequelui/shine";

export function Variant() {
  return (
    <Shine tempo={1.2}>
      …
    </Shine>
  );
}

Animation

A skewed light band rests outside the left edge and crosses the surface when the trigger fires. The overlay is remounted for every pass, so a second hover or a loop never queues behind an unfinished pass.

  • Default pass: 1200 ms with a [0.4, 0, 0.2, 1] curve and a −15° skew.
  • Triggers can be always-on, hover, tap or any combination.
  • Looping reschedules after an optional loopDelay instead of repeating inside the tween.
  • Reduced motion removes the overlay entirely.
1200 ms[0.4, 0, 0.2, 1]skew −15°remount per pass

API Reference

Each part accepts the usual HTML props in addition to the motion props below. No accessibility prop is hidden behind the animation layer.

Shine

PropTypeDefault
colorstring"currentColor"
opacitynumber0.3
durationnumber1200
delaynumber0
loopbooleanfalse
loopDelaynumber0
degnumber-15
enableOnHoverbooleanfalse
enableOnTapbooleanfalse
asChildbooleanfalse

Built by Vidhal. The source is available on GitHub.

Last updated: 11/17/2026