OpenSourceUIOpenSourceUIOpensource UI
GitHub—
  1. Home
  2. Components
  3. Background-pattern
  4. Dot Grid
Back to Background-patternComponents / Background-pattern

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. 1

    Run in your terminal:

    $npm install clsx tailwind-merge lucide-react
  2. 2

    Copy lib/cn.ts below. Skip if you already have cn().

  3. 3

    Copy the code below and create components/background-pattern/dot-grid-pattern.tsx in your project.

  4. 4

    Import and render:

    Example

    import { DotGridPattern } from "@/components/background-pattern/dot-grid-pattern";

    <DotGridPattern className="min-h-screen p-8"><section>Content</section></DotGridPattern>

lib/cn.ts

1
2
3
4
5
6
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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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 (
<div
ref={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 };
PreviousNext

On this

page

Jump to a section on this page.

  • lib/cn.ts
  • components/background-pattern/dot-grid-pattern.tsx
Platinum slotAvailable

Feature your product here.

Sticky card next to every component — highest-intent placement.

Claim this card