Dot Pattern Linear Gradient

PreviousNext

Example showing a dot pattern with linear gradient effects.

Docs
magicuiexample

Preview

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

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

export default function DotPatternLinearGradient() {
  return (
    <div className="bg-background relative flex size-full items-center justify-center overflow-hidden rounded-lg border p-20">
      <DotPattern
        width={20}
        height={20}
        cx={1}
        cy={1}
        cr={1}
        className={cn(
          "[mask-image:linear-gradient(to_bottom_right,white,transparent,transparent)]"
        )}
      />
    </div>
  )
}

Installation

npx shadcn@latest add @magicui/dot-pattern-linear-gradient

Usage

import { DotPatternLinearGradient } from "@/components/dot-pattern-linear-gradient"
<DotPatternLinearGradient />