Animation

Click Spark

Click ripple. Bursts a ring of short line sparks from the click point across any projected content. The canvas overlay has pointer-events: none, so projected DOM stays fully interactive.

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

Import

import { WrClickSpark } from 'ngwr/click-spark';

Playground

Click anywhere
<wr-click-spark
  sparkColor="var(--wr-color-dark)"
  [sparkCount]="8"
  [sparkRadius]="15"
  [sparkSize]="10"
  [duration]="400"
  easing="ease-out"
>
  <div>Click me</div>
</wr-click-spark>

Customize

Spark Count
8
Spark Radius (px)
15 px
Spark Size (px)
10 px
Duration (ms)
400 ms
Easing
Color

API

NameDescriptionTypeDefault
sparkColorSpark stroke colour. Accepts any CSS colour or a var(--wr-…) token, which is resolved against the theme.string'var(--wr-color-dark)'
sparkSizeLength of each spark line in px at start; tapers to 0 over the duration.number10
sparkRadiusDistance each spark travels from the origin in px.number15
sparkCountNumber of sparks per click, evenly distributed around the circle.number8
durationAnimation duration in ms.number400
easingEasing applied to travel distance.'linear' | 'ease-in' | 'ease-in-out' | 'ease-out''ease-out'
extraScaleMultiplier on travel distance — bumps the radius without changing sparkRadius.number1