Dot Shader

A GPU-accelerated interactive dot matrix background shader with magnetic cursor repulsion, proximity illumination glow, dynamic lens scaling, and ambient wave motion.

Accent:
Point Primitive Dot Matrix

Interactive Dot Shader

Move your pointer across the canvas to experience magnetic cursor repulsion and proximity illumination.

Installation

Add the component directly to your repository using shadcn CLI:

npx shadcn@latest add Surajmaurya1/easyui/dot-shader

API Reference

PropTypeDefaultDescription
childrenReactNodeOptional content rendered above the interactive dot shader canvas with full clickability
dotColorstring'rgba(255, 255, 255, 0.15)'Idle color of the background matrix dots (hex, rgb, or rgba)
accentColorstring'#00F0FF'Luminous highlight color of dots illuminated by cursor proximity
dotSizenumber1.5Base radius in pixels of each individual dot
spacingnumber22Distance in pixels between adjacent dots in the grid
cursorRadiusnumber180Radius in pixels of cursor influence and repulsion
distortionStrengthnumber0.35Force multiplier of magnetic repulsion away from the cursor (0 to 1)
maxScalenumber2.2Maximum scale multiplier of dots at peak cursor proximity
waveIntensitynumber0.25Amplitude of ambient idle sinusoidal wave motion
speednumber1Speed multiplier for the ambient background waves
interactivebooleantrueWhether dots react to cursor movements with repulsion and illumination
overlaybooleantrueEnables a soft radial vignette gradient to seamlessly blend container edges
classNamestringAdditional CSS classes for container sizing and layout