Background

Dot Pattern

Customizable SVG dot patterns with optional glow effects. Perfect for React applications requiring structured backgrounds with Next.js integration and TypeScript support.

Powered by

Loading component...

Installation

npx shadcn@latest add https://www.shadcn.io/registry/dot-pattern.json
npx shadcn@latest add https://www.shadcn.io/registry/dot-pattern.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/dot-pattern.json
bunx shadcn@latest add https://www.shadcn.io/registry/dot-pattern.json

Features

  • SVG-based dot patterns with customizable size, spacing, and positioning parameters
  • Optional glow animations featuring randomized timing for natural-looking pulsing effects
  • Mask image support enabling creative directional fades and gradient effects
  • Responsive scaling with automatic container size detection and pattern adjustment
  • Performance optimized using efficient SVG rendering and proper memoization
  • TypeScript support with comprehensive prop types for reliable integration
  • Motion integration providing smooth animations and transition effects
  • Tailwind CSS compatibility allowing easy styling with utility classes and color control

Examples

Linear Gradient Mask

Loading component...

Glow Effect

Loading component...

Custom Configuration

Loading component...

Use Cases

This free open source React component works well for:

  • Dashboard backgrounds - Subtle structured patterns for data-heavy interfaces built with Next.js
  • Landing page sections - Professional dot patterns that don't compete with content using TypeScript
  • Portfolio layouts - Clean geometric backgrounds showcasing work using shadcn/ui design
  • Documentation sites - Technical precision patterns for developer resources
  • App interfaces - Structured backgrounds that reinforce grid-based layouts using Tailwind CSS
  • Presentation templates - Professional patterns for slides and marketing materials

API Reference

DotPattern

PropTypeDefaultDescription
widthnumber16Horizontal spacing between dots
heightnumber16Vertical spacing between dots
xnumber0X-offset of the entire pattern
ynumber0Y-offset of the entire pattern
cxnumber1X-offset of individual dots
cynumber1Y-offset of individual dots
crnumber1Radius of each dot
glowbooleanfalseEnable glowing animation effect
classNamestringundefinedAdditional CSS classes to apply

Implementation Notes

  • Component automatically detects container size changes and adjusts pattern accordingly
  • Glow effect uses randomized animation delays and durations for natural-looking movement
  • Dot colors controlled using Tailwind text color utilities (e.g., text-blue-500/60)
  • Use mask images with Tailwind CSS classes to create directional fade effects
  • Optimized for performance with proper memoization and efficient SVG rendering
  • Compatible with shadcn/ui design system and all standard SVG props
  • Supports creative mask effects like linear gradients and radial patterns