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-TWUsage (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
| Prop | Type | Default | Description |
|---|---|---|---|
| spacing | number | 24 | Distance between adjacent dots. |
| dotSize | number | 2.2 | Base circle radius. |
| color | string (hex) | "#A855F7" | Color of excited dots near pointer. |
| magnetStrength | number | 28 | Displacement magnitude. |