Components

Sticker sheet

A sheet of die-cut stickers on backing paper, each in its own kiss-cut outline. Press one and it peels away, drag one and it comes off under the mouse; the outline stays behind and can take it back. For reward charts, sticker packs and anything you collect.

Install

terminal
npx shadcn@latest add @wobko/sticker-sheet

First time here? Add the registry to components.json first. How to install

Examples

A sheet to peel

Press a sticker (or Enter) and it lifts off, leaving its kiss-cut outline behind. Press the outline to stick it back. Hover one and its corner curls.

Backing paper and size

The backing is release paper with a sheen (glassine, the default), kraft or plain paper. Columns and size set the grid; shorthand `stickers` skips the items when you do not need labels or ids.

Sheet to board

Peel a sticker off the sheet (click it, or drag it with a mouse and let go over the board) and it lands on the board. Let go anywhere else and it springs back. Delete it on the board and it returns to its outline on the sheet.

API reference

StickerSheet

The backing paper (a Paper) with its printing: a dashed cut margin, crop marks, an optional typed title with how many stickers are left, and the sheen of release paper. Lays its children out on a grid.

PropTypeDefaultDescription
stickersstring[]-Ids from the art library: one item each, when you need no labels or ids of your own.
columns / sizenumber4 / 72Stickers per row, and the drawn size of each in px (below 80 the 64 px redraw is used). The grid keeps its column count and each cell is size + 22 px wide, so choose them for your narrowest screen (3 columns of 56 px fit a 320 px phone).
titlestring-Typed at the top of the sheet, with "n left" on the right. Also the group's accessible name.
backing"glassine" | "kraft" | "paper""glassine"Pale blue-gray release paper with a sheen, kraft, or plain paper.
peeled / defaultPeeled / onPeeledChangestring[]-Ids of the stickers that are off the sheet. Controlled: the parent decides what is peeled.
onPeel(item) => void-{ id, name, label, dragged, x, y }. For a drag, x and y are the pointer's client position at release: drop the sticker there (boardPoint from sticker-board turns them into canvas coordinates, and says whether the point is on the board at all). A controlled sheet that does not add the id to `peeled` declines the drag: the sticker springs back. A click or a key has no position: put it wherever you like.
onStick(item) => void-A peeled sticker was put back on its outline.
restorablebooleantrueWhether pressing an empty outline puts the sticker back. When off, a spent outline is dimmed (aria-disabled) rather than disabled, so the key that just peeled it keeps its focus.
disabled / labelboolean / string-Freeze the sheet; the name when there is no title (default "Sticker sheet").
stock-like propsPaperProps-tilt, tape, fastener, shadow, edge and the rest of Paper.

StickerSheetItem

One sticker in its outline. A button whose name says what it does now: "Peel Rocket sticker", then "Put Rocket sticker back". It lifts and turns a little on hover, curls its corner, and flies off up and to the right when peeled.

PropTypeDefaultDescription
namestring-The sticker's id in the art library.
idstring-Its key in the peeled list. Default the name; give each a different id if a name appears twice.
labelstring-What it is called to a reader (default the name in words).
sizenumber-Drawn size in px, overriding the sheet's.

Accessibility

  • The sheet is a named group; every sticker is a real button whose name changes with what pressing does ("Peel Rocket sticker" / "Put Rocket sticker back"). Enter and Space peel, exactly like a click.
  • What came off is announced politely ("Rocket peeled off.", "Rocket stuck back on."); the title shows how many are left.
  • While a sticker is in the hand the sheet rises above the rest of the page, so it can be carried over a board that comes after it in the source.
  • Dragging is a mouse and pen extra: touch never starts a drag (the page keeps scrolling), a tap peels. Every drag has a click or key equivalent, and releasing a drag near where it started springs the sticker back without peeling it.
  • The kiss-cut outlines and the printing are decoration (aria-hidden, no pointer events); the focus ring is drawn round the whole slot and never depends on color alone.
  • Reduced motion: no flight or curl animation, the sticker is simply gone or back. Calm density: no sheen, no crop marks.
  • Windows high contrast keeps the stickers and outlines (intrinsic art).

Source

The files the CLI copies into your project.

Loading the source