Xzero UI
Pro library

Sticker peelPro

Peel stickers off a surface with a real curl, move them around, and stick them back down.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui-pro/sticker-peel
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui-pro/sticker-peel

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { useState } from "react";
import { StickerPeel } from "@/components/xzero/sticker-peel/sticker-peel";
import type { StickerPlacement } from "@/components/xzero/sticker-peel/sticker-peel";

const stickers = [
  { id: "ship", label: "Ship it sticker", shape: "pill" as const, x: .3, y: .35, rotate: -6, content: <span className="ship">Ship it</span> },
  { id: "hello", label: "Hello sticker", shape: "circle" as const, x: .68, y: .6, rotate: 8, content: <span className="hello">hello</span> },
];

export function Lid() {
  const [positions, setPositions] = useState<Record<string, StickerPlacement>>();
  return <StickerPeel className="lid" stickers={stickers} positions={positions} onPositionsChange={setPositions} label="Laptop lid" />;
}

API reference

StickerPeel

A surface of stickers. Hovering lifts the nearest corner a few pixels, pulling folds the sticker back along a real fold with its backing showing, pulling far enough peels it off to carry around, and letting go settles it back down.

PropTypeDefaultDescription
stickers (required)StickerPeelItem[]–The stickers, each with an id, label, content, starting center (x and y from 0 to 1), optional rotate in degrees, and shape.
positionsRecord<string, StickerPlacement>–Controlled placements by id. Each is { x, y, rotate } with x and y from 0 to 1.
onPositionsChange(positions: Record<string, StickerPlacement>) => void–Called once a sticker settles somewhere new, with every placement. Works with or without positions.
labelstring"Stickers"Accessible name of the surface.
childrenReactNode–Content drawn on the surface under the stickers.
classNamestring–Class on the surface. Give it a size and background here.
styleCSSProperties–Inline style on the surface.

StickerPeelItem

One sticker.

PropTypeDefaultDescription
id (required)string–Stable id, used as the key in positions.
label (required)string–Accessible name, such as "Xzero logo sticker".
content (required)ReactNode–The printed face inside the white die cut border. Give it a fixed size.
x (required)number–Starting center across the surface, from 0 to 1.
y (required)number–Starting center down the surface, from 0 to 1.
rotatenumber0Starting rotation in degrees.
shape"circle" | "rounded" | "pill""rounded"Outline of the die cut. The peel starts from the real edge of this shape.

Keyboard interactions

KeysAction
TabMoves between stickers. Leaving a sticker you are carrying sticks it down.
Enter / SpacePicks the focused sticker up, or sticks it down where it is.
Arrow keysMoves a sticker you are carrying by 10px, or 40px with Shift.
EscapePuts a carried sticker back where it was picked up.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in playful

Guidance for AI tools

Sticker peel: Peel stickers off a surface with a real curl, move them around, and stick them back down. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components