OpenSourceUIOpenSourceUIOpensource UI
GitHub—
  1. Home
  2. Components
  3. Background-gradient
  4. Terrazzo Fragment
Back to Background-gradientComponents / Background-gradient

Terrazzo Fragment

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

Stone terrazzo base with scattered rose, teal, amber, and clay fragments — interior brands, cafés, and design studios.

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/terrazzo-fragment-background.tsx in your project.

  4. 4

    Import and render:

    Example

    import { TerrazzoFragmentBackground } from "@/components/background-gradient/terrazzo-fragment-background";

    <TerrazzoFragmentBackground className="min-h-screen p-8"><h1>Studio</h1></TerrazzoFragmentBackground>

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/terrazzo-fragment-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
import { forwardRef, type HTMLAttributes, type ReactNode } from "react";
 
import { cn } from "@/lib/cn";
 
export interface TerrazzoFragmentBackgroundProps extends HTMLAttributes<HTMLDivElement> {
children?: ReactNode;
}
 
const TerrazzoFragmentBackground = forwardRef<
HTMLDivElement,
TerrazzoFragmentBackgroundProps
>(({ children, className, ...props }, ref) => {
return (
<div
ref={ref}
data-slot="terrazzo-fragment-background"
className={cn("relative isolate overflow-hidden bg-[#F3F0EA]", className)}
{...props}
>
<div
aria-hidden="true"
className="pointer-events-none absolute inset-0 -z-10 bg-[linear-gradient(180deg,#FAF8F4_0%,#EEE8DF_100%)]"
/>
 
<div
aria-hidden="true"
className="pointer-events-none absolute inset-0 -z-10"
>
<div className="absolute top-[12%] left-[8%] h-10 w-16 rotate-[-18deg] rounded-md bg-[#D9C4A9] opacity-80" />
<div className="absolute top-[18%] left-[34%] h-8 w-8 rotate-[24deg] rounded-full bg-[#F43F5E] opacity-35" />
<div className="absolute top-[10%] right-[18%] h-12 w-20 rotate-[12deg] rounded-lg bg-[#99F6E4] opacity-55" />
<div className="absolute top-[42%] left-[14%] h-14 w-10 rotate-[36deg] rounded-md bg-[#A8A29E] opacity-55" />
<div className="absolute top-[36%] right-[12%] h-16 w-12 rotate-[-28deg] rounded-lg bg-[#FCD34D] opacity-45" />
<div className="absolute bottom-[28%] left-[42%] h-9 w-14 rotate-[-8deg] rounded-md bg-[#2DD4BF] opacity-40" />
<div className="absolute bottom-[18%] left-[10%] h-12 w-9 rotate-[42deg] rounded-lg bg-[#D6D3D1] opacity-70" />
<div className="absolute right-[24%] bottom-[14%] h-10 w-16 rotate-[-14deg] rounded-md bg-[#FB923C] opacity-40" />
<div className="absolute right-[8%] bottom-[34%] h-8 w-8 rotate-[16deg] rounded-full bg-[#78716C] opacity-45" />
<div className="absolute top-[58%] left-[58%] h-11 w-7 rotate-[30deg] rounded-md bg-[#5EEAD4] opacity-35" />
</div>
 
<div
aria-hidden="true"
className="pointer-events-none absolute inset-0 -z-10 [background-image:radial-gradient(circle_at_center,#57534E_1px,transparent_1px)] [background-size:4px_4px] opacity-[0.04]"
/>
 
{children}
</div>
);
});
 
TerrazzoFragmentBackground.displayName = "TerrazzoFragmentBackground";
 
export { TerrazzoFragmentBackground };
PreviousNext

On this

page

Jump to a section on this page.

  • lib/cn.ts
  • components/background-gradient/terrazzo-fragment-background.tsx
Platinum slotAvailable

Feature your product here.

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

Claim this card