Dot Field

Minimalist matrix of crisp micro-dots that warp gently around the pointer and shimmer along radial shockwaves with near-zero CPU overhead.

#dots#halftone#matrix#minimal

Customize

24px
2.2px
#A855F7
28

Installation

$pnpm dlx yourbrand@latest add @yourbrand/DotField-TS-TW
Usage (synced with live props)
<DotField
  spacing={24}
  dotSize={2.2}
  color="#A855F7"
  magnetStrength={28}
/>

Source Code

DotField.tsx
"use client";

import React from "react";

export interface DotFieldProps {
  spacing?: number;
  dotSize?: number;
  color?: string;
  magnetStrength?: number;
}

export function DotField({
  spacing = 24,
  dotSize = 2.2,
  color = "#A855F7",
  magnetStrength = 28,
}: DotFieldProps) {
  return (
    <div
      className="relative h-full w-full overflow-hidden rounded-2xl bg-[#0E0B13]"
      data-spacing={spacing}
      data-size={dotSize}
      data-color={color}
      data-strength={magnetStrength}
    />
  );
}

Props API

PropTypeDefaultDescription
spacingnumber24Distance between adjacent dots.
dotSizenumber2.2Base circle radius.
colorstring (hex)"#A855F7"Color of excited dots near pointer.
magnetStrengthnumber28Displacement magnitude.