Dot Pattern

A customizable dot pattern background component with optional glow animations and mask effects.

motion-sv

Installation

pnpm dlx shadcn-svelte@latest add https://sv-animations.vercel.app/r/dot-pattern.json

Usage

<script lang="ts">	import { DotPattern } from "#lib/components/magic/dot-pattern/index.js";</script>
<div class="relative h-64 overflow-hidden">	<DotPattern class="absolute inset-0" /></div>

Examples

Linear Gradient Mask

Glow Effect

Props

Dot Pattern

A customizable dot pattern background with optional animations.

NameTypeDefaultDescription
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
classClassValue""Additional CSS classes