DualSparks

Corner-based spark waves that radiate inward and outward with smooth motion.

DualSparks,
Background.

Installation

npx shadcn@latest add https://scrollxui.dev/registry/dualsparks.json 

Usage

import { DualSparks } from "@/components/ui/dualsparks";
<DualSparks
       sparkColor="#000000"
      sparkColorDark="#ffffff"
      sparkSize={2}
      sparkCount={22}
      ringsPerWave={3}
      waveInterval={1200}
      maxRadius={1000}
      corners="both"
      className="w-full h-[350px] flex items-center bg-black justify-center"
    >
      <h2 className="bg-clip-text text-transparent text-center bg-gradient-to-b from-neutral-900 to-neutral-700 dark:from-neutral-600 dark:to-white text-2xl md:text-4xl lg:text-7xl font-sans font-bold tracking-tight relative z-20">
        DualSparks, <br /> Background.
      </h2>
    </DualSparks>

Examples


Left

DualSparks,
Background.


Rightt

DualSparks,
Background.

API Reference

DualSparks

Corner-based spark waves that radiate inward and outward with smooth motion.

Props

PropertyTypeDefaultDescription
sparkColorstring"#000000"
Spark color used in light mode.
sparkColorDarkstring"#ffffff"
Spark color used when dark mode is active.
sparkSizenumber10
Length of each spark line segment.
sparkCountnumber24
Number of sparks emitted per ring.
durationnumber3500
Time (ms) for a spark wave to complete.
easingstring"ease-out"
Easing function applied to spark motion.
waveIntervalnumber1400
Delay (ms) between consecutive waves.
maxRadiusnumber800
Maximum outward expansion radius.
ringsPerWavenumber5
Number of concentric rings per wave.
ringSpacingnumber40
Distance between successive rings.
enableInwardbooleantrue
Enables inward collapsing spark waves.
corners"both" | "left" | "right""both"
Corner origin(s) for spark emission.
backgroundColorstring"white"
Background fill color in light mode.
backgroundColorDarkstring"black"
Background fill color in dark mode.
clearBackgroundbooleantrue
Clears or repaints the canvas each frame.
backgroundOpacitynumber0.15
Overrides alpha value of background color.
forceDarkModeboolean
Forces dark mode regardless of theme.
classNamestring
Custom classes for the container wrapper.
childrenReactNode
Content rendered above the spark canvas.

Built withby Ahdeetai.