uiniverse

backgrounds

DotGrid

Animated dot matrix background using pure CSS radial-gradient patterns with optional drift animation and radial fade mask.

v1.0.0react >=18next >=14tailwind >=4
backgrounddotspatterngriddecorative

Preview

Loading preview...

Props

PropTypeDefaultDescription
dotSizenumber1Dot radius in pixels
gapnumber24Space between dots in pixels
colorstringrgba(255,255,255,0.15)Dot color (any CSS color value)
animatebooleantrueEnable subtle drift animation
fadebooleantrueApply radial fade mask (vignette effect)
classNamestringAdditional Tailwind classes
idstringHTML id attribute

Layout

Display: block
Responsive: No

Fills container with absolute positioning. Requires a relative-positioned parent.

Examples

Basic usage

<div className="relative h-96 bg-black">
  <DotGrid />
  <div className="relative z-10 p-8">
    <h1>Content above dots</h1>
  </div>
</div>

Dense grid without fade

<div className="relative h-96 bg-neutral-950">
  <DotGrid gap={16} dotSize={1.5} fade={false} />
</div>

Custom color, no animation

<div className="relative h-96 bg-neutral-900">
  <DotGrid color="rgba(139,92,246,0.2)" animate={false} />
</div>

AI Usage Hint

Use DotGrid as a subtle background pattern. Place behind hero sections or feature grids. Enable fade for a vignette effect. Adjust gap and dotSize for density. Layer with other content using absolute positioning.

Works Well With

AuroraGradientMesh