Interactive Grid Pattern Demo

PreviousNext

Example showing an interactive grid pattern background.

Docs
magicuiexample

Preview

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

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

export default function InteractiveGridPatternDemo() {
  return (
    <div className="bg-background relative flex h-[500px] w-full flex-col items-center justify-center overflow-hidden rounded-lg border">
      <InteractiveGridPattern
        className={cn(
          "[mask-image:radial-gradient(400px_circle_at_center,white,transparent)]",
          "inset-x-0 inset-y-[-30%] h-[200%] skew-y-12"
        )}
      />
    </div>
  )
}

Installation

npx shadcn@latest add @magicui/interactive-grid-pattern-demo

Usage

import { InteractiveGridPatternDemo } from "@/components/interactive-grid-pattern-demo"
<InteractiveGridPatternDemo />