Animations

Dot Pattern

new

A dot grid for section backgrounds, with an optional slow pulse.

Edge network
Every request is served from the region closest to the visitor.

Installation

npx shadcn@latest add @blank/dot-pattern

Usage

import { DotPattern } from "@/components/ui/dot-pattern"
<div className="relative overflow-hidden">
  <DotPattern className="mask-radial-from-10% mask-radial-to-75%" />
</div>

The dots are one SVG pattern, not one element per dot, so a full-page background costs the same as a small card. They take currentColor, which is the border token unless you set a text-* class.

glow adds a few dozen extra dots that pulse in the foreground color. They are placed on the client after the element is measured, only animate while on screen, and hold still under reduced motion.

Props

PropTypeDefault
widthnumber16
heightnumber16
crnumber1
cxnumber1
cynumber1
glowbooleanfalse