Scrollstable
Peel
Page peel reveal
The top sheet lifts off the one underneath as the section scrolls past.
Underneath
Cover
Customize
Sheetthe top layer lifts off the one underneath
corner0.70
curlTimingscroll per phase, in stage heights
0.25
lead1.50
travel0.50
holdUsage
import { Peel } from "zerogravity/peel"
<Peel
front={<Cover />}
back={<Underneath />}
/>Generated from the controls above. Only props that differ from their defaults are shown.
Props
| Property | Type | Default | Description |
|---|---|---|---|
corner | "top-right" | "top-left" | "bottom-right" | "bottom-left" | "top-right" | Lifts from. |
curl | number | 0.7 | Curl. Range 0 to 1. |
lead | number | 0.25 | Before the peel. Range 0 to 3. |
travel | number | 1.5 | Peel length. Range 0.2 to 5. |
hold | number | 0.5 | Hold the reveal. Range 0 to 3. |
front | ReactNode | — | The sheet on top, the one that lifts away. |
back | ReactNode | — | What is underneath it. |
height | string | "100vh" | How tall the pinned stage is. |
scrollContainer | RefObject<HTMLElement> | — | Drive it from a scrollable element instead of the page. |
progress | number | — | Set the lift yourself, 0 to 1. Scroll is then ignored. |
disabled | boolean | false | Drops the peel: both layers stack as ordinary blocks. |
respectReducedMotion | boolean | true | Stacks the layers when the user asks for less motion. |
Dependencies
0 external runtime dependencies
Ships with nothing but React.