Dot field
Hero on a dot grid drawn with one CSS gradient.
Preview
Dots near the pointer swell and brighten with a springy falloff, and a slow wave crosses the grid when no pointer is around. One canvas, no library, with a pause button. With reduced motion turned on, it renders the plain layout.
Beta
A quiet grid that notices you
Dots swell and brighten around the pointer. Sample copy.
Beta
A quiet grid that notices you
Dots swell and brighten around the pointer. Sample copy.
Installation
Run this in a project that already uses shadcn/ui. It adds the component and anything it needs; the motion version also adds the plain one and the motion package.
Usage
import { DotField } from "@/components/custom/dot-field/dot-field";
<DotField
eyebrow="Beta"
title="A quiet grid that notices you"
description="Dots swell and brighten around the pointer."
primaryAction={{ label: "Get started", href: "/signup" }}
/>import { DotFieldMotion } from "@/components/custom/dot-field/dot-field-motion";
<DotFieldMotion title="A quiet grid that notices you" primaryAction={{ label: "Get started", href: "/signup" }} />Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title* (required) | string | – | The headline. |
| titleAs | "h1" | "h2" | "h1" | Use h2 when the page already has an h1. |
| eyebrow | string | – | Small badge above the title. |
| description | string | – | Supporting line under the title. |
| primaryAction | { label: string; href: string } | – | Filled button. |
| secondaryAction | { label: string; href: string } | – | Outline button. |
| ...props | React.ComponentProps<"section"> | – | Any other section attribute (id, aria-*, data-*, ref) goes to the root element. |
| Prop | Type | Default | Description |
|---|---|---|---|
| title* (required) | string | – | The headline. |
| titleAs | "h1" | "h2" | "h1" | Use h2 when the page already has an h1. |
| eyebrow | string | – | Small badge above the title. |
| description | string | – | Supporting line under the title. |
| primaryAction | { label: string; href: string } | – | Filled button. |
| secondaryAction | { label: string; href: string } | – | Outline button. |
| ...props | React.ComponentProps<"section"> | – | Any other section attribute (id, aria-*, data-*, ref) goes to the root element. |
Accessibility
- The dot grid is decorative and hidden from screen readers; the copy sits on a patch of the page background so it stays readable.
- The idle wave loops, so the motion version shows a Pause background button (WCAG 2.2.2). Drawing also stops while off screen.
- With reduced motion the static CSS grid is shown and there is no canvas or button.
- The motion version follows the visitor's reduced-motion setting and never hides content before it animates.