Mesh Net, animated React component
A distorted triangle net that hides in the dark until the cursor comes near. Nodes are shoved outward on springs, overshoot a little as they settle, and the edges light up like a torch passing over them, then fade out again with distance.
- Pro
- Background Effects
- Hover
- Spring
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 |
|---|---|---|---|
| color | string | "#5b4fe0" | Colour of the lit edges, as a 6-digit hex. |
| background | string | "#000000" | Colour the canvas is cleared to. |
| gridSize | number | 64 | Spacing between nodes, in px. |
| distortion | number | 0.5 | Random offset of each node, as a fraction of the spacing (0 to 0.5). |
| revealRadius | number | 230 | Radius around the pointer where the net shows and reacts, in px. |
| push | number | 30 | How far nodes are shoved away from the pointer, in px. |
| autoplay | boolean | false | A ghost pointer drifts in a slow loop until a real pointer arrives. Pauses off screen and never runs under reduced motion. |
| className | string | — | Extra classes for the wrapper. |
| children | ReactNode | — | Content layered above the net. |