Move the pointer hereYour content sits on top of the dots.

Code

<!-- dot-field.free.js: download it from the Install section below and host it with your site -->
<script src="/dot-field.free.js" defer></script>

<dot-field gap="22" radius="130" theme="light" style="height: 420px">
  <h1>Infrastructure that stays out of your way</h1>
</dot-field>

In context

All systems normal99.98%uptime over the last 90 days
Behind a status line
ChangelogFourteen releases this quarter. Here is what changed.
Sunset, dense grid Pro

Install · Free Web Component

One file, no dependencies. Aurora preset, every other option included. Host it yourself so your visitors never load anything from our servers.

1. Install with one command — or download the file
shadcn CLI · React
npx shadcn@latest add https://www.ui-design.co/r/dot-field.json
2. Load it and use the element
HTML
<!-- dot-field.free.js: download it from the Install section below and host it with your site -->
<script src="/dot-field.free.js" defer></script>

<dot-field gap="22" radius="130" theme="light" style="height: 420px">
  <h1>Infrastructure that stays out of your way</h1>
</dot-field>
3. React + TypeScript (optional)

The shadcn command adds a typed React wrapper for you. Using the file directly? Custom elements work in React as-is; for type checking add:

TypeScript
// dot-field.d.ts
declare namespace JSX {
  interface IntrinsicElements {
    'dot-field': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
      gap?: number | string;
      radius?: number | string;
      idle?: 'true' | 'false';
      theme?: 'light' | 'dark';
    };
  }
}

Pro · React + TypeScript Pro

One payment of $4.99, yours forever. Use it in unlimited personal and commercial projects; no resale.

  • React component with TypeScript types and the full source, plus a ref with setPoint / clearPoint to drive the lens yourself
  • Sunset, Mint and Mono tints for the lit dots, plus custom tints from Brand Fit
  • The vanilla Web Component with every tint, a demo page, README and license

Attributes & props

NameTypeDefaultDescription
children elements—Rendered on top of the dots. The field fills the box of the element, so give it a height (or let the content set one).
gap number (px)22Distance between dots. Dot size follows it. Very large areas widen the gap by themselves to stay fast.
radius number (px)130How far the pointer reaches: the size of the lens.
idle 'true' | 'false''true'A slow wave of light crosses the field when the pointer is away. Off leaves a still grid that only answers the pointer.
theme 'light' | 'dark''light'Ink-blue dots for a light page, pale dots that glow for a dark one. The background stays transparent: the page shows through.
tint Pro'aurora' | 'sunset' | 'mint' | 'mono' | object'aurora'The colours the lit dots take, or a custom tint. Free build ships Aurora only.
setPoint(x, y) / clearPoint() methods—Place a virtual pointer, 0–1 across the box, and take it away. The same through the data-x / data-y attributes.
--dotf-mask CSS mask imagenoneA mask for the dots only, e.g. a radial gradient so the grid fades out toward the edges.

Everything is drawn on one 2D canvas, sized by a ResizeObserver and capped at 2× pixel density. The pointer is read from the window, so the lens also works when the field lies behind other content. Each dot is a small spring: it is pushed away from the pointer in proportion to its distance, which is what makes the centre look magnified and the rim crowded. The loop stops while the field is off-screen or the tab is hidden, and when the idle wave is off it stops as soon as the dots have settled. With reduced motion the dots light under the pointer but do not move, and the wave stands still.

More components