Cubes Grid, animated React component
A field of 3D cubes that ripples under the cursor. Moving the pointer lifts cubes into a travelling wave that spreads, bounces off the edges and settles on its own. Pick a flat light isometric floor with soft crest highlights, or a dark tilted grid fading into fog with glowing crests. One canvas and one animation loop, no re-renders.
- Pro
- Background Effects
- Hover
Play with it
Move the controls and watch it change. Copy code gives you a snippet with only the props you changed.
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| variant | "isometric" | "perspective" | "isometric" | The flat light isometric floor, or the dark tilted 3D grid. |
| autoplay | boolean | — | Drops random ripples while the pointer is idle so the grid demos itself. Same as idleRipples, and wins over it when set. |
| idleRipples | boolean | true | Drops random ripples when the pointer stops. |
| idleDelay | number | 1.5 | Seconds the grid stays still before random ripples start. |
| amplitude | number | — | Wave height. Isometric: in tiles (0.7). Perspective: in cube sizes (0.9). |
| glow | number | — | Strength of the light on the wave crests (0.5 isometric, 0.9 perspective). 0 turns it off. |
| speed | number | — | Wave speed, in cubes per second (7 isometric, 9 perspective). |
| damping | number | — | Wave energy kept per second, 0 to 1 (0.08 isometric, 0.1 perspective). Lower settles faster. |
| gap | number | — | Seam between cubes. Isometric: a fraction of a tile (0.025). Perspective: world units (0.16). |
| cellSize | number | 150 | Isometric only. On-screen width of one tile, in px. |
| topColor | string | "#fafaf9" | Isometric only. Top face colour. |
| leftColor | string | "#e7e5e4" | Isometric only. Left face colour. |
| rightColor | string | "#d6d3d1" | Isometric only. Right face colour. |
| glowColor | string | "#a8a29e" | Isometric only. Colour of the light that follows the ripple. |
| gridSize | number | 40 | Perspective only. Number of cubes per side. |
| baseColor | string | "#2a2a30" | Perspective only. Cube colour at rest. |
| waveColor | string | "#ff6a2b" | Perspective only. Colour of the wave crests. |
| backgroundColor | string | "#0b0b0d" | Perspective only. Scene background and fog colour. |
| tilt | number | 0.7 | Perspective only. Camera tilt away from top-down, in radians. |
| className | string | — | Extra classes for the canvas wrapper. |