Grid Pattern Dashed

PreviousNext

Example showing a dashed grid pattern.

Docs
magicuiexample

Preview

Loading preview…
registry/example/grid-pattern-dashed.tsx
"use client"

import { cn } from "@/lib/utils"
import { GridPattern } from "@/registry/magicui/grid-pattern"

export default function GridPatternDashed() {
  return (
    <div className="bg-background relative flex size-full items-center justify-center overflow-hidden rounded-lg border p-20">
      <GridPattern
        width={30}
        height={30}
        x={-1}
        y={-1}
        strokeDasharray={"4 2"}
        className={cn(
          "[mask-image:radial-gradient(300px_circle_at_center,white,transparent)]"
        )}
      />
    </div>
  )
}

Installation

npx shadcn@latest add @magicui/grid-pattern-dashed

Usage

import { GridPatternDashed } from "@/components/grid-pattern-dashed"
<GridPatternDashed />