DDBS UI
effect

Gradient Backdrop

Abstract artwork behind a section that fills its parent, ignores pointer events and falls back to a CSS gradient when the image fails to load.

npx shadcn@latest add https://ui.develop-better-solutions.com/r/gradient-backdrop.json
Fullscreen

Content over artwork

Usage

gradient-backdrop-example.tsx
import { GradientBackdrop } from "@dbs/ui";

export default function GradientBackdropExample() {
  return (
    <div className="relative grid h-[320px] w-full place-items-center overflow-hidden rounded-xl bg-surface">
      <GradientBackdrop src="/samples/hero-wave.jpg" fallback={<div className="absolute inset-0 bg-[linear-gradient(135deg,#e5693c33,#2e3a8c33)]" />} />
      <p className="relative rounded-full bg-canvas/80 px-4 py-2 text-sm font-medium text-ink backdrop-blur">Content over artwork</p>
    </div>
  );
}