Ballmac UI home

Dot Pattern

A lightweight SVG dot grid background with an optional radial fade and a few softly pulsing glow dots. One pattern element, token colors, hydration-safe, still under reduced motion.

Changelog

Small details, shipped weekly.

Every Friday: fixes, polish and one thing you asked for.

Installation

$ pnpm dlx shadcn@latest add @ballmac/dot-pattern

Usage

import { DotPattern } from "@/components/ballmac/dot-pattern"

The full example is in the Code tab above.

Examples

Dense, no glow

Empty inbox

Nothing needs your attention right now.

API reference

PropTypeDefault
width

Horizontal spacing between dots in pixels.

number16
height

Vertical spacing between dots in pixels.

number16
radius

Dot radius in pixels.

number1
glow

Make a few random dots glow and pulse softly.

booleanfalse
glowCount

How many dots glow at once when `glow` is on.

number18
glowColor

Color of the glowing dots. Any CSS color or var().

string"var(--chart-1)"
radialMask

Fade the pattern out toward the edges with a radial mask.

booleantrue

Also accepts the standard attributes of its root element.

Use with AI

Place <DotPattern /> as the first child of a relative, overflow-hidden container (absolute inset-0, aria-hidden, pointer-events-none). Add glow for a few pulsing accent dots. The cheapest Ballmac background; safe for large areas. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Dot Pattern (@ballmac/dot-pattern) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Quiet texture behind heroes, feature cards, empty states and auth pages
  • Large page areas where canvas effects would be too heavy

Not for

  • When you want visible motion as the focal point (use flickering-grid or beams-background)

Registry JSON: https://ui.ballmac.com/r/dot-pattern.json

Credits

Free to use in personal and commercial projects.

npm
None
Registry
shadcn/utils