Xzero UI
Pro library

Dot gridPro

A dot field that bulges around the cursor like a lens and ripples from every click.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui-pro/dot-grid
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui-pro/dot-grid

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { DotGrid } from "@/components/xzero/dot-grid/dot-grid";

export function Hero() {
  return (
    <DotGrid style={{ height: 480 }}>
      <h1>Interfaces with a pulse</h1>
    </DotGrid>
  );
}

API reference

DotGrid

A canvas field of dots that bulge away from the pointer like a lens, wobble back on a spring, and ripple outward from every click. Content placed inside sits on top and stays interactive.

PropTypeDefaultDescription
gapnumber22Distance between dots in px. Lower is denser.
dotSizenumber1.4Dot radius in px at rest.
radiusnumber150Lens radius around the pointer in px.
strengthnumber16How far dots are pushed at the strongest point of the lens, in px.
ripplebooleantrueClicks and taps send a ripple through the field.
fadebooleantrueFades the field toward its edges.
colorstring–Dot color at rest. Defaults to the strong border token.
activeColorstring–Color dots take under the lens and in ripples. Defaults to the accent token.
childrenReactNode–Content drawn over the field, such as a hero headline.
classNamestring–Class on the root. Give it a height or let children size it.
styleCSSProperties–Inline style on the root.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in cursor

Guidance for AI tools

Dot grid: A dot field that bulges around the cursor like a lens and ripples from every click. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components