Animation

Shiny Text

Shimmer-over-text effect. A bright stripe sweeps across the text using background-clip: text + an animated background-position. Pure CSS port — no JS animation loop.

Angular adaptation of an effect by David Haz / reactbits.dev.

Import

import { WrShinyText } from 'ngwr/shiny-text';

Playground

Premium
<wr-shiny-text
  text="Premium"
  [speed]="2"
  [spread]="120"
  direction="left"
  [yoyo]="false"
  [pauseOnHover]="false"
/>

Customize

Speed (s)
2.0 s
Spread (°)
120 °
Direction
Yoyo
Pause on Hover
Text

Directive variant ([wrShimmer])

import { WrShimmer } from 'ngwr/shiny-text';

<h1 wrShimmer>Premium</h1>

Premium

API

NameDescriptionTypeDefault
textrequiredText to render.string—
disabledPause the animation.booleanfalse
speedTime for the bright stripe to traverse the text, in seconds.number2
colorBase text colour (outside the bright stripe). Unset, it falls back to --wr-shiny-text-base.string | nullnull
shineColorBright stripe colour. Unset, it falls back to the theme token.string | nullnull
spreadGradient angle in degrees.number120
yoyoBounce back-and-forth instead of restarting.booleanfalse
pauseOnHoverPause the animation while hovered.booleanfalse
directionSweep direction.'left' | 'right''left'
delayPause between sweeps in seconds.number0
[wrShimmer]Lightweight directive variant — adds the .wr-shimmer host class for a continuous sweep over any element. Same package.directive—

CSS variables

Custom properties ngwr/shiny-text publishes. Each default below is declared on the component's own selector, so a :root override is shadowed by it — set them on that selector, on a wrapper you scope yourself, or inline on the element. Unlike the BEM class names, these are the supported way to restyle the component.

VariableDefaultDeclared on
--wr-shiny-text-basevar(--wr-color-on-surface-muted, #8594a4).wr-shiny-text +1 variant override
--wr-shiny-text-shinevar(--wr-color-on-surface, #0f172a).wr-shiny-text +1 variant override