Hulian UIv0.93.5413 components0 components
  • Start
  • Components
  • Blocks
  • Pages
  • Demos
  • Changelog
ChineseEnglish
  • ComponentsComponents
  • ThemeTheme

Backgrounds

  • DotPattern
  • GridPattern
  • StripedPattern
  • Spotlight
  • FadeMask
  • RetroGrid
  • Ripple
  • Meteors
  • Aurora
  • Particles
  • FlickeringGrid
  • WavyBackground
  • Silk
  • Iridescence
  • Threads
  • Orb
  • LiquidChrome
  • Balatro
  • Ballpit
  • Beams
  • ColorBends
  • DarkVeil
  • Dither
  • DotField
  • EvilEye
  • FaultyTerminal
  • Ferrofluid
  • FloatingLines
  • Galaxy
  • GradientBlinds
  • Grainient
  • GridDistortion
  • GridMotion
  • GridScan
  • Hyperspeed
  • LetterGlitch
  • Lightfall
  • Lightning
  • LightPillar
  • LightRays
  • LineWaves
  • LiquidEther
  • PixelBlast
  • PixelSnow
  • Plasma
  • PlasmaWave
  • Prism
  • PrismaticBurst
  • Radar
  • RippleGrid
  • ShapeGrid
  • SideRays
  • SoftAurora

Overlay Effects

  • BorderBeam
  • ShineBorder
  • GlareHover
  • Lens
  • AnimatedBeam
  • OrbitingCircles
  • ProgressiveBlur
  • CardSpotlight
  • Reveal
  • Antigravity
  • BlobCursor
  • ClickSpark
  • Crosshair
  • ElectricBorder
  • GhostCursor
  • GradualBlur
  • ImageTrail
  • LaserFlow
  • MagicRings
  • Magnet
  • MagnetLines
  • MetaBalls
  • MetallicPaint
  • OrbitImages
  • PixelTrail
  • PixelTransition
  • Ribbons
  • ShapeBlur
  • SplashCursor
  • StarBorder
  • StickerPeel
  • TargetCursor
  • Cubes
  • Tilt
  • BorderGlow
  • GlassIcons
  • GlassSurface
  • Lanyard
  • ModelViewer
  • FluidGlass

ClickSpark

click-spark

Emits short radial spark lines from pointer clicks.

Usage

Basic usage

Wrap any content and click anywhere within it to emit a circle of foreground color sparks at the click point.

Click here to emit sparks
tsx
<div className="relative h-56 cursor-pointer overflow-hidden rounded-xl border border-border">
  <ClickSpark className="absolute inset-0">
    {/* Your content */}
  </ClickSpark>
</div>

Custom color and quantity

sparkColor goes to token, sparkCount / sparkRadius to control spark density and burst range.

Click here to emit sparks
tsx
<ClickSpark
  sparkColor="var(--color-chart-3)"
  sparkCount={12}
  sparkRadius={22}
  className="absolute inset-0"
>
  {/* Your content */}
</ClickSpark>

Big outbreak

Lengthen the line segment, enlarge the radius, and slow down the easing for a more dramatic celebratory burst.

Click here to emit sparks
tsx
<ClickSpark
  sparkColor="var(--color-chart-1)"
  sparkCount={16}
  sparkSize={18}
  sparkRadius={36}
  duration={700}
  easing="ease-in-out"
  extraScale={1.2}
  className="absolute inset-0"
>
  {/* Your content */}
</ClickSpark>

When to Use

Use it to emit a radial spark burst wherever someone clicks inside a button area, card, or interactive hero. It is a wrapper, so clicks on its content define each burst origin. Use BlobCursor for a liquid cursor trail, Antigravity for a full particle field, or Crosshair for target tracking.

Import

ts
import { ClickSpark } from "@hulianui/ui"

Props

NameTypeDefaultDescription
sparkColorstringvar(--color-foreground)Spark color (automatic light and dark theme), can pass any CSS color
sparkSizenumber10Initial spark-segment length in pixels; higher values create bolder strokes
sparkRadiusnumber15The maximum radius of sparks flying (px), determines the burst range
sparkCountnumber8The number of sparks emitted by one click (average 360°)
durationnumber400Spark animation duration in milliseconds; higher values leave a longer-lived trail
easing"linear" | "ease-in" | "ease-out" | "ease-in-out""ease-out"Sparks fly out of the easing curve
extraScalenumber1Radius extra scaling factor, >1 for amplified burst, <1 for convergence
classNamestring-Transparent to the root container (relative DOM element)
styleCSSProperties-Inline styles forwarded to the root container

Slots

SlotTypeDescription
childrenReactNodePackage content, click anywhere within it and sparks will burst out at the click point

Usage Guidelines

  • The token used for sparkColor must be prefixed with --color- (var(--color-foreground)), and the canvas strokeStyle feed var(--foreground) does not resolve. See [[hulian-token-color-var-needs-color-prefix]].
  • It is a wrapper: sparks are only triggered when clicked in the wrapped children area; the root container must be the positioning context (relative).
  • No sparks are released under reduced-motion; the component stays silent.
  • Client component ("use client"): when the canvas is unavailable it silently skips, so neither

SSR nor jsdom errors out. Real sparks still need a browser runtime.

Related

BorderBeam · ShineBorder · GlareHover · Lens · AnimatedBeam · OrbitingCircles

Playground

Click here to emit sparks
<div className="relative h-56 cursor-pointer overflow-hidden rounded-xl border border-border">
  <ClickSpark
    sparkCount={8}
    sparkSize={10}
    sparkRadius={15}
    duration={400}
    easing="ease-out"
    className="absolute inset-0"
  >
    {/* Your content */}
  </ClickSpark>
</div>
PreviousBlobCursorDecorationNextCrosshair

On this page

  • Usage
  • Documentation
    • When to Use
    • Import
    • Props
    • Slots
    • Usage Guidelines
    • Related
  • Playground