OpenSourceUIOpenSourceUIOpensource UI
GitHub—
  1. Home
  2. Components
  3. Background-gradient
  4. Dark Midnight Mesh
Back to Background-gradientComponents / Background-gradient

Dark Midnight Mesh

Free Background-gradient React component — DarkMidnightMeshBackground. MIT licensed, copy-paste ready for Next.js and Tailwind CSS.

Midnight frost mesh with whisper-soft grid, teal and sky blooms, and a gentle vignette — dashboards, terminals, and refined dark UI.

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-gradient/dark-midnight-mesh-background.tsx in your project.

  4. 4

    Import and render:

    Example

    import { DarkMidnightMeshBackground } from "@/components/background-gradient/dark-midnight-mesh-background";

    <DarkMidnightMeshBackground className="min-h-screen p-8"><h1 className="text-neutral-100">Console</h1></DarkMidnightMeshBackground>

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-gradient/dark-midnight-mesh-background.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import { forwardRef, type HTMLAttributes, type ReactNode } from "react";
 
import { cn } from "@/lib/cn";
 
export interface DarkMidnightMeshBackgroundProps extends HTMLAttributes<HTMLDivElement> {
children?: ReactNode;
}
 
const DarkMidnightMeshBackground = forwardRef<
HTMLDivElement,
DarkMidnightMeshBackgroundProps
>(({ children, className, ...props }, ref) => {
return (
<div
ref={ref}
data-slot="dark-midnight-mesh-background"
className={cn("relative isolate overflow-hidden bg-[#0A0D10]", className)}
{...props}
>
<div
aria-hidden="true"
className="pointer-events-none absolute inset-0 -z-10 bg-[linear-gradient(145deg,#101418_0%,#0A0D10_52%,#06080A_100%)]"
/>
 
<div
aria-hidden="true"
className="pointer-events-none absolute inset-0 -z-10 [background-image:linear-gradient(to_right,rgba(148,163,184,0.10)_1px,transparent_1px),linear-gradient(to_bottom,rgba(148,163,184,0.10)_1px,transparent_1px)] [background-size:28px_28px] opacity-[0.14]"
/>
 
<div
aria-hidden="true"
className="pointer-events-none absolute inset-0 -z-10 [background-image:linear-gradient(to_right,rgba(148,163,184,0.08)_1px,transparent_1px),linear-gradient(to_bottom,rgba(148,163,184,0.08)_1px,transparent_1px)] [background-size:7px_7px] opacity-[0.06]"
/>
 
<div
aria-hidden="true"
className="pointer-events-none absolute -inset-8 -z-10 blur-3xl"
>
<div className="absolute -top-[16%] -left-[10%] h-[54%] w-[54%] rounded-full bg-[#2DD4BF] opacity-16" />
<div className="absolute top-[8%] -right-[12%] h-[48%] w-[48%] rounded-full bg-[#38BDF8] opacity-14" />
<div className="absolute -bottom-[18%] left-[20%] h-[50%] w-[50%] rounded-full bg-[#34D399] opacity-12" />
</div>
 
<div
aria-hidden="true"
className="pointer-events-none absolute inset-0 -z-10 [background-image:radial-gradient(circle_at_center,rgba(255,255,255,0.75)_1px,transparent_1px)] [background-size:6px_6px] opacity-[0.04]"
/>
 
<div
aria-hidden="true"
className="pointer-events-none absolute inset-0 -z-10 [background-image:radial-gradient(circle_at_center,transparent_54%,rgba(0,0,0,0.42)_100%)]"
/>
 
{children}
</div>
);
});
 
DarkMidnightMeshBackground.displayName = "DarkMidnightMeshBackground";
 
export { DarkMidnightMeshBackground };
PreviousNext

On this

page

Jump to a section on this page.

  • lib/cn.ts
  • components/background-gradient/dark-midnight-mesh-background.tsx
Platinum slotAvailable

Feature your product here.

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

Claim this card