Sparkles Core

A high-performance, zero-dependency particle sparkle canvas with multi-shape geometry (circles, radiant diamond stars, cross starlets), organic twinkling, interactive cursor repulsion/attraction, click particle bursts, and fluid SSR safety.

Particle Sparkles Engine

Sparkles Core

Multi-shape geometry, continuous twinkling phase modulation, and cursor repulsion dynamics.

Installation

Add the component directly to your repository using shadcn CLI:

npx shadcn@latest add Surajmaurya1/easyui/sparkles-core

API Reference

PropTypeDefaultDescription
idstringOptional unique HTML id attribute for the canvas element
backgroundstring'transparent'Background color of the sparkle container (CSS color, hex, rgba, or gradient)
classNamestringAdditional CSS utility classes applied to the root container
particleColorstring'#FFFFFF'Primary color for single-tint particle sparkle fields
particleColorsstring[]Array of colors distributed across sparkles for chromatic or starry night effects
minSizenumber0.6Minimum radius/size in pixels for spawned sparkles
maxSizenumber2.4Maximum radius/size in pixels for spawned sparkles
particleSizenumberUniform particle size override (locks both minSize and maxSize)
speednumber1Particle movement velocity multiplier
particleDensitynumber120Particle density factor calculated relative to a 400x400 area
particleCountnumberExact particle count override ignoring density calculations
particleShape'circle' | 'star' | 'cross' | 'mixed''circle'Geometry shape of particles: circle, 4-point radiant star, cross starlet, or mixed
direction'none' | 'top' | 'bottom' | 'left' | 'right''none'Directional flow drift; none provides organic cosmic floating
twinklebooleantrueEnables dynamic sinusoidal twinkle opacity pulsation
twinkleSpeednumber1Frequency speed multiplier for twinkle pulsation
interactivebooleantrueEnables mouse pointer tracking and interaction reactions
cursorMode'repulse' | 'attract' | 'sparkle' | 'none''repulse'Cursor reaction: repulse away, attract toward cursor, or sparkle illuminate
cursorRadiusnumber140Influence radius in pixels around the pointer
clickPushnumber6Number of spark particles burst on click/tap
opacitynumber1Global master opacity scalar for the sparkle canvas
blurnumber0CSS blur filter radius in pixels for soft glowing bloom
childrenReactNodeOptional content rendered above the sparkles with full clickability and isolation