0

Component

Peel sticker

A die-cut sticker whose corner lifts and folds back when you touch it.

ship it 🚀
many models,
one chat
made in MP 🇮🇳

Usage

<PeelSticker peel={48}>
  <span>ship it</span>
</PeelSticker>

Source

Copy both files into your project. The component has no dependencies beyond React.

"use client";

import type { CSSProperties, ReactNode } from "react";
import styles from "./peel-sticker.module.css";

type PeelStickerProps = {
  children: ReactNode;
  /** How far the corner lifts, in pixels. */
  peel?: number;
  /** Sticker colour behind the content. */
  color?: string;
  className?: string;
};

export function PeelSticker({ children, peel = 44, color = "#f08a3c", className }: PeelStickerProps) {
  return (
    <div
      className={[styles.sticker, className].filter(Boolean).join(" ")}
      style={{ "--peel-to": `${peel}px`, "--sticker": color } as CSSProperties}
      tabIndex={0}
    >
      <div className={styles.face}>
        <div className={styles.print}>{children}</div>
      </div>
      <div className={styles.flapShadow} aria-hidden="true">
        <div className={styles.flap} />
      </div>
    </div>
  );
}