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

Paper Fold

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

Tactile cardstock with a diagonal crease, soft highlight, and shadow — invitations, stationery, and craft portfolios.

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/paper-fold-background.tsx in your project.

  4. 4

    Import and render:

    Example

    import { PaperFoldBackground } from "@/components/background-gradient/paper-fold-background";

    <PaperFoldBackground className="min-h-screen p-8"><h1>Folded</h1></PaperFoldBackground>

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/paper-fold-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
import { forwardRef, type HTMLAttributes, type ReactNode } from "react";
 
import { cn } from "@/lib/cn";
 
export interface PaperFoldBackgroundProps extends HTMLAttributes<HTMLDivElement> {
children?: ReactNode;
}
 
const PaperFoldBackground = forwardRef<
HTMLDivElement,
PaperFoldBackgroundProps
>(({ children, className, ...props }, ref) => {
return (
<div
ref={ref}
data-slot="paper-fold-background"
className={cn("relative isolate overflow-hidden bg-[#F8F6F1]", className)}
{...props}
>
<div
aria-hidden="true"
className="pointer-events-none absolute inset-0 -z-10 bg-[linear-gradient(160deg,#FCFBF8_0%,#F3F0E8_48%,#ECE7DD_100%)]"
/>
 
<div
aria-hidden="true"
className="pointer-events-none absolute inset-0 -z-10 bg-[linear-gradient(128deg,transparent_42%,rgba(120,113,108,0.10)_49.5%,rgba(255,255,255,0.55)_50.5%,transparent_58%)]"
/>
 
<div
aria-hidden="true"
className="pointer-events-none absolute inset-0 -z-10 [background-image:linear-gradient(to_right,rgba(255,255,255,0.35)_1px,transparent_1px),linear-gradient(to_bottom,rgba(255,255,255,0.25)_1px,transparent_1px)] [background-size:32px_32px] opacity-50"
/>
 
<div
aria-hidden="true"
className="pointer-events-none absolute inset-0 -z-10 [background-image:radial-gradient(circle_at_28%_22%,rgba(255,255,255,0.65)_0%,transparent_42%)]"
/>
 
<div
aria-hidden="true"
className="pointer-events-none absolute inset-0 -z-10 [background-image:radial-gradient(circle_at_78%_82%,rgba(120,113,108,0.08)_0%,transparent_48%)]"
/>
 
{children}
</div>
);
});
 
PaperFoldBackground.displayName = "PaperFoldBackground";
 
export { PaperFoldBackground };
PreviousNext

On this

page

Jump to a section on this page.

  • lib/cn.ts
  • components/background-gradient/paper-fold-background.tsx
Platinum slotAvailable

Feature your product here.

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

Claim this card