Wavy Grid
v1.0.0A grid of fine lines rolling in slow, layered waves, with a soft swell that follows the pointer. Works on a light or dark ground. Shows a still grid under reduced motion.
Installation
Run once in your project root to configure paths and dependencies:
npx vectorvesper initDownloads and registers the component in your project:
npx vectorvesper add wavy-gridIf installing manually or managing your package lock:
npm install @vectorvesper/motion threeUsage
A quiet hero background that still moves: a SaaS landing page, a portfolio, a conference site. It works on a light or dark background; set the three colours to match.
Import
Usage
Do
- Make highlight the strongest colour; it is what the crests show.
- Turn fade off when the grid should run to the edges, for example behind a full-width band.
Don't
- Do not push density very high on a phone; the lines get closer than a pixel and shimmer.
WebGL — render it on the client only
On Next.js, load it with ssr: false from a Client Component, as below. Vite apps need nothing extra.
prefers-reduced-motion and provides a graceful fallback.Props
A grid of fine lines rolling in slow, layered waves and drifting upward. The lines take the highlight colour on the crests and fade in the dips, and a soft swell rises under the pointer.
<WavyGrid />
The grid, with your content laid over it. Fills the area, which is 100svh tall unless you size it.
| Prop | Type | Default | Description |
|---|---|---|---|
color | string | "#b8c2ea" | The colour of the lines in the troughs. |
highlight | string | "#2438a8" | The colour the lines take on the crests. |
background | string | "#f4f3f0" | The colour behind the grid. |
density | number | 22 | How many grid cells fit the height. |
amplitude | number | 0.8 | How tall the waves are. 0 keeps the grid flat. |
speed | number | 0.6 | How fast the waves move. |
drift | number | 0.05 | How fast the grid drifts upward. 0 holds it still. |
swell | number | 1.2 | How high the pointer raises the grid. 0 turns it off. |
reach | number | 0.25 | How far the swell spreads, as a share of the height. |
fade | boolean | true | Fades the grid out toward the edges. |
className | string | — | Sizes the area. Without a height it is 100svh tall. |
style | React.CSSProperties | — | Inline styles for the area. A height here wins over the default. |
children | React.ReactNode | — | Content drawn over the grid. |