ReactHive

Sticker Bomb

Backgrounds 9

About

Click anywhere and a sticker slaps down, so the section fills with a collage of your own. The next sticker rides under the pointer. Hover one and its edge lifts; drag to peel it back, and pull far enough to tear it off: it shows its paper back and drops off the page.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Sticker Bomb to your project and fits it to your theme.

Code

How Sticker Bomb is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import type { CSSProperties } from "react";
import { StickerBomb } from "@/components/ui/sticker-bomb";

const settings = {
  initial: 8,
  limit: 24,
  size: 1
};

/* The demo's Google Fonts. In a Next.js app, use next/font/google instead. */
if (typeof document !== "undefined" && !document.getElementById("sticker-bomb-fonts")) {
  const style = document.createElement("style");
  style.id = "sticker-bomb-fonts";
  style.textContent = "@import url('https://fonts.googleapis.com/css2?family=Bagel+Fat+One&family=Bricolage+Grotesque:wght@200..800&display=swap'); .rh-bagel-fat-one { font-family: 'Bagel Fat One', sans-serif; } .rh-bricolage-grotesque { font-family: 'Bricolage Grotesque', sans-serif; }";
  document.head.appendChild(style);
}

const display = { className: "rh-bagel-fat-one", style: { fontFamily: "'Bagel Fat One', sans-serif" } };
const text = { className: "rh-bricolage-grotesque", style: { fontFamily: "'Bricolage Grotesque', sans-serif" } };

const ground = "#0b5d4b";
const ink = "#141414";
const yolk = "#ffd23f";

// The headline is a sticker too: yolk letters with an ink outline, die-cut with a white border and a soft
// shadow under the whole cut, all from rings of hard text shadows.
const ring = (r: number, steps: number, color: string, dy = 0, blur = 0) =>
  Array.from({ length: steps }, (_, i) => {
    const a = (i / steps) * Math.PI * 2;
    return `${(Math.cos(a) * r).toFixed(3)}em ${(Math.sin(a) * r + dy).toFixed(3)}em ${blur}em ${color}`;
  });
const dieCut: CSSProperties = {
  color: yolk,
  textShadow: [
    ...ring(0.012, 12, ink),
    ...ring(0.026, 24, ink),
    ...ring(0.06, 32, "#fff"),
    ...ring(0.095, 40, "#fff"),
    ...ring(0.095, 12, "rgba(0,0,0,0.16)", 0.07, 0.05),
  ].join(", "),
};

function DemoContent(props: Partial<typeof settings> = {}) {
  const v = { ...settings, ...props };
  return (
    <main className={`${text.className} text-[#fff4dc]`} style={{ background: ground }}>
      <style>{`
        @keyframes bomb-slap { 0% { opacity: 0; transform: rotate(-5deg) scale(1.45); } 35% { opacity: 1; transform: none; scale: 0.94; } 60% { scale: 1.03; } 100% { scale: 1; } }
        @keyframes bomb-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
        @media (prefers-reduced-motion: reduce) { .bomb-in { animation: none !important; } }
      `}</style>
      <StickerBomb className="h-svh min-h-[38rem]" initial={Number(v.initial)} limit={Number(v.limit)} size={Number(v.size)}>
        <div className="flex h-full items-center justify-center px-6 text-center">
          <div className="flex flex-col items-center">
            <h1
              className={`${display.className} bomb-in -rotate-4 text-[19vw] leading-[0.92] sm:text-[clamp(3.4rem,11vw,10rem)] tracking-[-0.01em] animate-[bomb-slap_0.7s_cubic-bezier(0.22,1,0.36,1)_0.15s_both]`}
              style={dieCut}
            >
              Leave <br className="sm:hidden" />
              Your
              <br />
              Mark.
            </h1>
            <p className="bomb-in mt-9 max-w-[21rem] text-[17px] leading-[25px] font-medium text-balance text-[#fff4dc]/85 [text-shadow:0_0_14px_#0b5d4b,0_0_4px_#0b5d4b] animate-[bomb-rise_0.8s_cubic-bezier(0.22,1,0.36,1)_0.45s_both]">
              Click anywhere to stick one on. Grab a sticker by its edge and peel it off.
            </p>
            <a
              href="#"
              className="bomb-in mt-8 animate-[bomb-rise_0.8s_cubic-bezier(0.22,1,0.36,1)_0.6s_both] rounded-full border-[3px] border-[#141414] bg-[#fff4dc] px-7 py-3 text-[16px] font-bold text-[#141414] shadow-[0_0_0_5px_#fff,0_10px_18px_rgba(0,0,0,0.28)] transition-[background-color,rotate,scale] duration-500 ease-[cubic-bezier(0.19,1,0.22,1)] hover:-rotate-3 hover:scale-[1.04] hover:bg-[#ffd23f] active:scale-[0.97] focus-visible:outline-2 focus-visible:outline-offset-8 focus-visible:outline-[#fff4dc]"
            >
              Start a Project
            </a>
          </div>
        </div>
      </StickerBomb>
    </main>
  );
}

/** The demo in its own colours, filling the frame. */
export default function Demo(props: Partial<typeof settings> = {}) {
  return (
    <div className="min-h-svh w-full" style={{ background: "#0b5d4b" }}>
      <DemoContent {...props} />
    </div>
  );
}

More by ReactHive

View all
  • Card Deal

    Card Deal

    219
  • Arc Gallery

    Arc Gallery

    143
  • Fluid Type

    Fluid Type

    119
  • Step Stack

    Step Stack

    98
  • Iris Scroll

    Iris Scroll

    67
  • Card Pack

    Card Pack

    64
  • Word Drum

    Word Drum

    38
  • Colour Wash Slider

    Colour Wash Slider

    32

More in Backgrounds

View all
  • Elegant Dark Pattern

    Elegant Dark Pattern

    974
  • Background snippets

    Background snippets

    122
  • Dark Gradient Background

    Dark Gradient Background

    168
  • Gradient Backgrounds

    Gradient Backgrounds

    29
  • Background Components

    Background Components

    48
  • Gradient Blur Bg

    Gradient Blur Bg

    60
  • Gradient Background 4

    Gradient Background 4

    315
  • Honey Ember Background

    Honey Ember Background

    104

Explore more

Part of ReactHive UI — browse the full library on 21st.dev.