Introducing Magic UI Pro - 50+ blocks and templates to build beautiful landing pages in minutes.

Command Palette

Search for a command to run...

Docs
Interactive Grid Pattern

Interactive Grid Pattern

A interactive background grid pattern made with SVGs, fully customizable using Tailwind CSS.

Installation

pnpm dlx shadcn@latest add "https://magicui.design/r/interactive-grid-pattern"

Examples

Colorful

Usage

import { InteractiveGridPattern } from "@/components/magicui/interactive-grid-pattern";
<div className="relative h-[500px] w-full overflow-hidden">
  <InteractiveGridPattern />
</div>

Props

PropTypeDefaultDescription
widthnumber40Width of each square in the grid
heightnumber40Height of each square in the grid
squares[number, number][24,24]Number of squares in the grid. First number is horizontal squares, second is vertical squares
classNamestring-Class name applied to the grid container
squaresClassNamestring-Class name applied to individual squares in the grid