Paper sticker
A die-cut sticker badge whose corner peels.
<piix-paper-sticker>DOM + canvasNew<piix-paper-sticker>New</piix-paper-sticker>
Shape
A vinyl sticker with a thick white die-cut border, stuck on at a jaunty angle. Hover and its corner curls back to show the shiny backing; click and it slaps back down. Pill, circle or star.
Installation
<!-- once, anywhere on the page: every component --> <script src="https://cdn.jsdelivr.net/npm/piixpal@0.6/piixpal.min.js"></script>
<!-- just paper sticker (the shared engine loads itself, once) --> <script src="https://cdn.jsdelivr.net/npm/piixpal@0.6/dist/c/paper-sticker.min.js"></script>
npm install piixpal // once, in your entry file import "piixpal";
// npm install piixpal
import "piixpal";
export default function Page() {
return (
<piix-paper-sticker>New</piix-paper-sticker>
);
}
Usage
<piix-paper-sticker>New</piix-paper-sticker>
Examples
Shapes and colours
<piix-paper-sticker>New</piix-paper-sticker> <piix-paper-sticker color="#5cffb0" shape="circle" tilt="8">50% off</piix-paper-sticker> <piix-paper-sticker color="#ff8ad8" shape="star" tilt="-10">Hot</piix-paper-sticker>
API reference
| Attribute | What it does | Default |
|---|---|---|
color | sticker colour | #ffd23f |
ink | text colour | #1d1a2b |
shape | pill circle star | pill |
tilt | degrees | -6 |
Accessibility
- Its text is plain and read as normal.
- With reduced motion it doesn't peel.