Default
Hover the bottom-right corner, drag it, or click. The sheet underneath is out of reach until the corner is open.
A page whose corner curls back to show the sheet underneath. Hover the corner to lift it, drag it to peel along a diagonal crease, click or press Enter to open it. For a discount code, a hint, a secret, a P.S.
npx shadcn@latest add @wobko/peel-corner第一次使用?先把 registry 加进 components.json。 如何安装
Hover the bottom-right corner, drag it, or click. The sheet underneath is out of reach until the corner is open.
corner="bottom-left" mirrors everything (use it for right-to-left pages); back="kraft" makes the flap the same stock as the page.
A real use: the code lives on the sheet underneath, with a working button. It is inert until the corner is open, then a normal control. Controlled, so the page can open it too.
The root: a positioned box that holds the page and the sheet under it, draws the turned-back flap (the back of the paper, with its stepped shadow on the sheet underneath) and puts a 56 px corner button over it. The flap is drawn once and scaled about the corner, so crease and shadow stay in proportion at every stage.
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| peeled / defaultPeeled / onPeeledChange | boolean | - | Controlled or uncontrolled: true when the corner is open and the sheet underneath can be read. |
| size | number | 120 | How big the turned-back corner is when open, px. A drag can go about a third further. |
| corner | "bottom-right" | "bottom-left" | "bottom-right" | Which corner curls; the bottom left mirrors the flap, the clip and the underneath content. |
| back | PaintKey | "paper" | The token the flap (the back of the page) is made of: "kraft" for a kraft page, "sticky-yellow" for a sticky note. |
| label | string | "Peel back the corner" | Accessible name of the corner button. |
CLI 会复制进你项目的文件。
正在加载源码