Peel Sticker
A sticker you peel back by its corner to reveal what is under it. Free, MIT · Interactive blocks › Stickers, tickets and boards
A sticker over a small area: drag its lifted corner to peel it back, see its reverse side, and release past the threshold to uncover what is under it. The corner stays under the finger in any direction, springs back when let go too early and peels off on its own once released past the threshold. A regular Open button does the same from the keyboard. The fold is CSS clip-path geometry relative to the sticker's size; there is no graphics engine.
Installation
npx valyro-cli@latest add peel-sticker
npx shadcn@latest add https://valyro.xyz/r/peel-sticker.json
npm install valyro-ui
import 'valyro-ui/styles.css';
import { PeelSticker } from 'valyro-ui';
Props
| Prop | Type | Default | |
|---|---|---|---|
cover * | ReactNode | The face of the sticker: what lies on top while it is closed. | |
children | ReactNode | What the sticker reveals. It cannot be focused while the sticker is closed. | |
open | boolean | Controlled open; use with onOpenChange. | |
defaultOpen | boolean | false | Initial open when uncontrolled. |
onOpenChange | (open: boolean, reason: PeelStickerReason) => void | A request to open or close, once per button press or finished gesture (reason), when it is decided, without waiting for the animation. Not a confirmation of anything on a server. | |
corner | 'top-start' | 'bottom-end' | 'bottom-end' | The lifted corner, on the logical sides (mirrored in right-to-left pages). Default bottom-end. |
threshold | number | 0.55 | Share of the diagonal the corner must be peeled before release opens the sticker (a quick flick needs less). Default 0.55. |
reclosable | boolean | true | Show a Close action once open. Default true. |
material | 'paper' | 'gloss' | 'foil' | 'paper' | Material of the sticker: paper (default), gloss or foil. Same mechanics, different surface. |
disabled | boolean | false | Neither the gesture nor the button work. |
labels | Partial<PeelStickerLabels> | Overrides for the built-in English text; keys left out keep their defaults. |
Related components
- Scratch Reveal — Scratch off a cover to reveal text or a picture
- Tear-off Ticket — A ticket whose stub tears off along the perforation
- Split-Flap Board — Mechanical departure board: only the changed characters flip
- Swipe Action Card — Swipe a card sideways to reveal its actions
- Feature Hotspots — Numbered points on an image that open a note about each detail
- Exploded Layers — Prepared image layers pulled apart with captions
- Prediction Card — The reader guesses first, then sees the answer and the explanation
- Detail Dial — Choose how deep an explanation goes: short, detailed or full
- Version Scrubber — Step through prepared versions of a design with one slider
- Page Minimap — Schematic map of a long page with the visible area
- Sticker Board — A free composition of photos, stickers and notes to move and rotate
- Lasso Select — Drag a rectangle to select a group of cards
Previous: Page Minimap · Next: Scratch Reveal · All Interactive blocks