# Dot Grid

> A quiet grid of dots lit by a drifting wave and by the cursor.

## Spec sheet

| | |
| --- | --- |
| Access | Free: no account, free for commercial use |
| Shelf | Backgrounds › Backgrounds |
| Live preview | https://uibrik.com/components/dot-grid |
| Writes | 1 files into `components/uibrik/dot-grid/`, plus `components/uibrik/_shader-background/ShaderSurface.tsx` |
| Packages | none beyond React |
| Needs | React 19, Tailwind CSS v4, a project set up with `npx shadcn@latest init` |
| Theme | Reads the shadcn tokens and follows class-based dark mode ([theming](https://uibrik.com/docs/theming.md)) |
| Updated | Nov 9, 2026 |

## Add it

```bash
npx shadcn@latest add https://uibrik.com/r/dot-grid.json
```

With the `@uibrik` namespace in `components.json` ([setup](https://uibrik.com/docs/installation.md)): `npx shadcn@latest add @uibrik/dot-grid`.

Can't run commands? https://uibrik.com/components/dot-grid/prompt-full.txt has every file verbatim, with the setup steps, ready for an assistant to write.

## Render it

Renders as is; every value shown is the default, so delete any line you don't need.

```tsx
import { DotGrid } from "@/components/uibrik/dot-grid/dot-grid";

<DotGrid
  colors={["#2fb4d2", "#3a9ef2", "#5a82ea", "#34c1b0"]}
  dotColor=""
  background=""
  shape="circle"
  pattern="grid"
  spacing={20}
  size={2.5}
  intensity={0.7}
  twinkle={0.5}
  glow={0.6}
  ambient={0.5}
  fade={1}
  speed={1}
  grain={0}
  animate
  interactive
  radius={160}
  follow={0.6}
  trail={0.6}
  magnify={0.5}
  ripples
>
  …
</DotGrid>
```

## Tune it

The same props as the Customize panel on https://uibrik.com/components/dot-grid.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `colors` | `string[]` | `["#2fb4d2","#3a9ef2","#5a82ea","#34c1b0"]` | Colours the dots light up in, 2 to 6. |
| `dotColor` | `string` | `""` | Resting dot colour; empty follows the theme. |
| `background` | `string` | `""` | Base colour behind the dots; empty follows the page. |
| `shape` | `"circle" \| "square" \| "diamond"` | `"circle"` | Dot shape. |
| `pattern` | `"grid" \| "stagger"` | `"grid"` | "stagger" shifts every other row by half a step. |
| `spacing` | `number` | `20` | Distance between dots. |
| `size` | `number` | `2.5` | Dot diameter. |
| `intensity` | `number` | `0.7` | Strength of the drifting colour wave; 0 leaves only the pointer light. |
| `twinkle` | `number` | `0.5` | How often single dots sparkle. |
| `glow` | `number` | `0.6` | Soft halo around lit dots. |
| `ambient` | `number` | `0.5` | Pale wash of colour drifting under the grid. |
| `fade` | `number` | `1` | Fade toward the edges, so the grid has no hard border. |
| `speed` | `number` | `1` | Animation speed; 1 is the designed pace. |
| `grain` | `number` | `0` | Film grain strength. |
| `animate` | `boolean` | `true` | Move on its own. Off draws one still frame. |
| `interactive` | `boolean` | `true` | React to the pointer. |
| `radius` | `number` | `160` | How far the pointer light reaches. |
| `follow` | `number` | `0.6` | How lazily the light follows the pointer, 0 (locked) to 1 (drifts after it). |
| `trail` | `number` | `0.6` | How much the light stretches into a tail while the pointer moves. |
| `magnify` | `number` | `0.5` | Loupe strength: how much the dots under the light are enlarged. |
| `ripples` | `boolean` | `true` | A click sends a ring of light across the grid. |

## Wire it

The props the Customize panel doesn't show: ranges, data, content and callbacks.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `children` | `ReactNode` |  | Content shown on top of the background. |
| `className` | `string` |  | Classes for the box; it fills whatever size you give it. |

## Where it fits

- **Subtle SaaS heroes**: A quiet grid lit by a drifting wave adds texture behind a headline without colour noise.
- **Docs and product pages**: Cursor-lit dots give plain pages a little depth while keeping text easy to read.
- **Developer tool sites**: A grid backdrop fits technical brands that favour structure over decoration. Pairs with [ASCII Field](https://uibrik.com/components/ascii-field.md) (Pro).

## Same shelf: Backgrounds

- [Fluted Glass](https://uibrik.com/components/fluted-glass.md) (Pro): A band of light seen through fluted glass, broken into steep slivers rib by rib.
- [Grain Gradient](https://uibrik.com/components/grain-gradient.md): Colour that folds slowly like silk, finished with film grain.
- [Halftone](https://uibrik.com/components/halftone.md): A screen of lit dots: swirling ribbons of light drawn by the size and brightness of each dot.
- [Halftone Horizon](https://uibrik.com/components/halftone-horizon.md) (Pro): An arched horizon printed in halftone in the dark, where the dots grow with the light until they fuse into a smooth glow.
- [Horizon Gradient](https://uibrik.com/components/horizon-gradient.md): Black fading through deep blue to white in bands that arch like a horizon, breathing slowly.
- [Ice Tiles](https://uibrik.com/components/ice-tiles.md) (Pro): Soft blobs of colour seen through a wall of frosted ice cubes, stepping from cube to cube.

## Ground rules

- Only the props above exist. To change anything else, edit the installed file.
- Keep the files in `components/uibrik/dot-grid/` so the import paths keep resolving.
- The playbook for working with the whole library: https://uibrik.com/llms.txt
