Skip to Content
🎉Introducing Pumki UI
AnimationsClick Sparks

Click Spark Animation

A component that renders animated spark bursts when the user clicks anywhere inside its container.

Pumki UIPumki UI

Installation

Usage


1import { ClickSpark } from '@/components/pumki-ui/animations/click-spark';

Wrap your clickable area (e.g., button, div) inside <ClickSpark> to add burst animations:


1<ClickSpark sparkColor="#ff3366" sparkSize={12} sparkRadius={20} sparkCount={10} duration={500}>
2 <button>Click Me</button>
3</ClickSpark>

Props

PropTypeDefaultDescription
sparkColorstring”#fff”Color of the sparks (HEX or CSS color).
sparkSizenumber10Length of each spark line.
sparkRadiusnumber15Radius of spark spread from the click point.
sparkCountnumber8Total number of sparks emitted per click.
durationnumber400Duration of spark animation in milliseconds.
easing”linear” | “ease-in” | “ease-out” | “ease-in-out""ease-out”Easing function applied to spark motion.
extraScalenumber1.0Additional scale multiplier for spark distance.
childrenReact.ReactNode-Any clickable content to wrap inside the spark animation.
Last updated on