ValyroUI Русская версия

Peel Sticker

A sticker you peel back by its corner to reveal what is under it. Free, MIT · Animated components › 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

PropTypeDefault
cover *ReactNodeThe face of the sticker: what lies on top while it is closed.
childrenReactNodeWhat the sticker reveals. It cannot be focused while the sticker is closed.
openbooleanControlled open; use with onOpenChange.
defaultOpenbooleanfalseInitial open when uncontrolled.
onOpenChange(open: boolean, reason: PeelStickerReason) => voidA 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.
thresholdnumber0.55Share of the diagonal the corner must be peeled before release opens the sticker (a quick flick needs less). Default 0.55.
reclosablebooleantrueShow 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.
disabledbooleanfalseNeither the gesture nor the button work.
labelsPartial<PeelStickerLabels>Overrides for the built-in English text; keys left out keep their defaults.

Related components

Previous: Halftone Image Reveal · Next: Scratch Reveal · All Animated components