Dot Pattern Demo

PreviousNext

Example showing a background dot pattern made with SVGs.

Docs
magicuiexample

Preview

Loading preview…
registry/example/dot-pattern-demo.tsx
"use client"

import { cn } from "@/lib/utils"
import { DotPattern } from "@/registry/magicui/dot-pattern"

export default function DotPatternDemo() {
  return (
    <div className="bg-background relative flex h-[500px] w-full flex-col items-center justify-center overflow-hidden rounded-lg border">
      <DotPattern
        className={cn(
          "[mask-image:radial-gradient(300px_circle_at_center,white,transparent)]"
        )}
      />
    </div>
  )
}

Installation

npx shadcn@latest add @magicui/dot-pattern-demo

Usage

import { DotPatternDemo } from "@/components/dot-pattern-demo"
<DotPatternDemo />