Dot Grid
Free Background-pattern React component — DotGridPattern. MIT licensed, copy-paste ready for Next.js and Tailwind CSS.
Soft dotted grid on neutral paper — watch mockup stages, device demos, and minimal product sections.
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/dot-grid-pattern.tsxin your project. - 4
Import and render:
Exampleimport { DotGridPattern } from "@/components/background-pattern/dot-grid-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/dot-grid-pattern.tsx
import { forwardRef, type HTMLAttributes, type ReactNode } from "react";import { cn } from "@/lib/cn";export interface DotGridPatternProps extends HTMLAttributes<HTMLDivElement> {children?: ReactNode;}const DotGridPattern = forwardRef<HTMLDivElement, DotGridPatternProps>(({ children, className, ...props }, ref) => {return (<divref={ref}data-slot="dot-grid-pattern"className={cn("relative isolate overflow-hidden bg-neutral-50 [background-image:radial-gradient(circle,#e8e8e8_1px,transparent_1px)] [background-size:12px_12px]",className,)}{...props}>{children}</div>);},);DotGridPattern.displayName = "DotGridPattern";export { DotGridPattern };