Graph Paper
Free Background-pattern React component — GraphPaperPattern. MIT licensed, copy-paste ready for Next.js and Tailwind CSS.
Clean square grid for sketches, wireframes, and planning boards — subtle ink lines on white.
Preview
Your content
Setup
How to use
Free for personal and commercial use. No UI attribution required. Include the MIT copyright notice when copying component source into your project. Read the MIT license.
- 1
Run in your terminal:
$npm install clsx tailwind-merge lucide-react - 2
Copy
lib/cn.tsbelow. Skip if you already havecn(). - 3
Copy the code below and create
components/background-pattern/graph-paper-pattern.tsxin your project. - 4
Import and render:
Exampleimport { GraphPaperPattern } from "@/components/background-pattern/graph-paper-pattern";
lib/cn.ts
import { type ClassValue, clsx } from "clsx";import { twMerge } from "tailwind-merge";export function cn(...inputs: ClassValue[]) {return twMerge(clsx(inputs));}
components/background-pattern/graph-paper-pattern.tsx
import { forwardRef, type HTMLAttributes, type ReactNode } from "react";import { cn } from "@/lib/cn";export interface GraphPaperPatternProps extends HTMLAttributes<HTMLDivElement> {children?: ReactNode;}const GraphPaperPattern = forwardRef<HTMLDivElement, GraphPaperPatternProps>(({ children, className, ...props }, ref) => {return (<divref={ref}data-slot="graph-paper-pattern"className={cn("relative isolate overflow-hidden bg-white [background-image:linear-gradient(to_right,rgba(0,0,0,0.05)_1px,transparent_1px),linear-gradient(to_bottom,rgba(0,0,0,0.05)_1px,transparent_1px)] [background-size:20px_20px]",className,)}{...props}>{children}</div>);},);GraphPaperPattern.displayName = "GraphPaperPattern";export { GraphPaperPattern };