Cherry Petal
Free Background-gradient React component — CherryPetalBackground. MIT licensed, copy-paste ready for Next.js and Tailwind CSS.
Soft spring canvas with drifting cherry petals and a blush radial glow — weddings, florists, and seasonal campaigns.
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-gradient/cherry-petal-background.tsxin your project. - 4
Import and render:
Exampleimport { CherryPetalBackground } from "@/components/background-gradient/cherry-petal-background";
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-gradient/cherry-petal-background.tsx
import { forwardRef, type HTMLAttributes, type ReactNode } from "react";import { cn } from "@/lib/cn";export interface CherryPetalBackgroundProps extends HTMLAttributes<HTMLDivElement> {children?: ReactNode;}const CherryPetalBackground = forwardRef<HTMLDivElement,CherryPetalBackgroundProps>(({ children, className, ...props }, ref) => {return (<divref={ref}data-slot="cherry-petal-background"className={cn("relative isolate overflow-hidden bg-[#FFF7F8]", className)}{...props}><divaria-hidden="true"className="pointer-events-none absolute inset-0 -z-10 bg-[radial-gradient(circle_at_50%_0%,#FFE8EC_0%,#FFF7F8_48%,#FFF1F3_100%)]"/><divaria-hidden="true"className="pointer-events-none absolute inset-0 -z-10"><div className="absolute top-[8%] left-[10%] h-10 w-14 rotate-[-24deg] rounded-[100%_100%_20%_100%] bg-[#FDA4AF] opacity-55 blur-[0.5px]" /><div className="absolute top-[16%] right-[14%] h-8 w-11 rotate-[18deg] rounded-[100%_100%_20%_100%] bg-[#FB7185] opacity-45 blur-[0.5px]" /><div className="absolute top-[34%] left-[28%] h-9 w-12 rotate-[32deg] rounded-[100%_100%_20%_100%] bg-[#FECDD3] opacity-60 blur-[0.5px]" /><div className="absolute top-[28%] right-[30%] h-7 w-10 rotate-[-12deg] rounded-[100%_100%_20%_100%] bg-[#F43F5E] opacity-30 blur-[0.5px]" /><div className="absolute bottom-[30%] left-[16%] h-8 w-11 rotate-[8deg] rounded-[100%_100%_20%_100%] bg-[#FDA4AF] opacity-40 blur-[0.5px]" /><div className="absolute right-[10%] bottom-[22%] h-10 w-14 rotate-[-30deg] rounded-[100%_100%_20%_100%] bg-[#FB7185] opacity-50 blur-[0.5px]" /><div className="absolute bottom-[12%] left-[48%] h-7 w-9 rotate-[22deg] rounded-[100%_100%_20%_100%] bg-[#FECDD3] opacity-55 blur-[0.5px]" /></div><divaria-hidden="true"className="pointer-events-none absolute inset-0 -z-10 [background-image:radial-gradient(circle_at_center,#9F1239_1px,transparent_1px)] [background-size:6px_6px] opacity-[0.03]"/>{children}</div>);});CherryPetalBackground.displayName = "CherryPetalBackground";export { CherryPetalBackground };