Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Dot Field

Pro

A canvas dot grid that swells and brightens around the pointer.

Installation

pnpm dlx shadcn@latest add @viewport/dot-field

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

PropTypeDefault
gapnumber

Distance between dots in pixels.

22
radiusnumber

Dot radius in pixels.

1
reachnumber

Radius of the cursor's influence in pixels.

140
colorstring

Dot color. Defaults to the current text color.

—
classNamestring—

Accessibility

  • Canvas is aria-hidden.
  • Renders a static grid under reduced motion.
  • Pauses when off screen and only animates while the pointer moves.