Mouse Repel Dots
Customize
Props
| Property | Type | Default | Description |
|---|---|---|---|
dotRadius | number | 1.6 | Base radius (px) of each dot in its resting state. |
dotSpacing | number | 22 | Gap in px between adjacent dots in the grid. |
repelRadius | number | 80 | Radius (px) around the cursor within which dots are repelled. |
force | number | 5.5 | Strength of the repulsion force applied to dots near the cursor. |
springK | number | 0.07 | Spring constant — how strongly each dot snaps back to its origin. |
damping | number | 0.72 | Velocity damping factor applied each frame (0–1). Lower = bouncier. |
maxDotSize | number | 6 | Maximum dot radius (px) when fully displaced by the cursor. |
dotColor | string | "#7a5af8" | Base dot color used in the resting / low-energy state. |
dotColorMid | string | "#d35af8" | Mid-energy dot color shown at medium displacement. |
dotColorHot | string | "#ffffff" | High-energy dot color for dots closest to the cursor. |
backgroundColor | string | "transparent" | Canvas background fill. Use "transparent" to inherit the parent background. |
gradientFrom | string | null | Start color of a diagonal linear gradient that overrides dotColor/dotColorMid/dotColorHot. |
gradientTo | string | null | End color of the diagonal linear gradient. Both gradientFrom and gradientTo must be set. |
bulgeOnly | boolean | false | When true, dots push outward smoothly instead of flying with spring physics. |
bulgeStrength | number | 30 | Outward push distance (px) used when bulgeOnly is enabled. |
waveAmplitude | number | 0 | Amplitude (px) of a continuous ambient sine-wave ripple across the grid. 0 disables it. |
sparkleMode | "off" | "random" | "pulse" | "ripple" others.. | "off" | Pattern used to light up sparkle dots across the grid. |
sparkleColor | string | "#d35af8" | Color applied to dots when they sparkle. |
sparkleSize | number | 1.6 | Size multiplier applied to a dot at peak sparkle intensity. |
sparkleSpeed | number | 0.4 | Playback speed of sparkle animations. Higher = faster sweep/pulse. |
sparkleDensity | number | 0.015 | Fraction of dots that sparkle simultaneously in random mode (0–1). |
className | string | "" | Extra CSS classes forwarded to the wrapper div. |
dotRadiusnumberBase radius (px) of each dot in its resting state.
1.6dotSpacingnumberGap in px between adjacent dots in the grid.
22repelRadiusnumberRadius (px) around the cursor within which dots are repelled.
80forcenumberStrength of the repulsion force applied to dots near the cursor.
5.5springKnumberSpring constant — how strongly each dot snaps back to its origin.
0.07dampingnumberVelocity damping factor applied each frame (0–1). Lower = bouncier.
0.72maxDotSizenumberMaximum dot radius (px) when fully displaced by the cursor.
6dotColorstringBase dot color used in the resting / low-energy state.
"#7a5af8"dotColorMidstringMid-energy dot color shown at medium displacement.
"#d35af8"dotColorHotstringHigh-energy dot color for dots closest to the cursor.
"#ffffff"backgroundColorstringCanvas background fill. Use "transparent" to inherit the parent background.
"transparent"gradientFromstringStart color of a diagonal linear gradient that overrides dotColor/dotColorMid/dotColorHot.
nullgradientTostringEnd color of the diagonal linear gradient. Both gradientFrom and gradientTo must be set.
nullbulgeOnlybooleanWhen true, dots push outward smoothly instead of flying with spring physics.
falsebulgeStrengthnumberOutward push distance (px) used when bulgeOnly is enabled.
30waveAmplitudenumberAmplitude (px) of a continuous ambient sine-wave ripple across the grid. 0 disables it.
0sparkleMode"off" | "random" | "pulse" | "ripple" others..Pattern used to light up sparkle dots across the grid.
"off"sparkleColorstringColor applied to dots when they sparkle.
"#d35af8"sparkleSizenumberSize multiplier applied to a dot at peak sparkle intensity.
1.6sparkleSpeednumberPlayback speed of sparkle animations. Higher = faster sweep/pulse.
0.4sparkleDensitynumberFraction of dots that sparkle simultaneously in random mode (0–1).
0.015classNamestringExtra CSS classes forwarded to the wrapper div.
""Crafted withbyMohammad Tasin
