ZeroGravity UI

Scrollstable

Peel

Page peel reveal

The top sheet lifts off the one underneath as the section scrolls past.

Underneath
Cover
scrolls inside this frame

Customize

Sheetthe top layer lifts off the one underneath
corner
0.70curl
Timingscroll per phase, in stage heights
0.25lead
1.50travel
0.50hold

Usage

TSX
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

12 documented props on Peel
PropertyTypeDefaultDescription
corner"top-right" | "top-left" | "bottom-right" | "bottom-left""top-right"Lifts from.
curlnumber0.7Curl. Range 0 to 1.
leadnumber0.25Before the peel. Range 0 to 3.
travelnumber1.5Peel length. Range 0.2 to 5.
holdnumber0.5Hold the reveal. Range 0 to 3.
frontReactNode—The sheet on top, the one that lifts away.
backReactNode—What is underneath it.
heightstring"100vh"How tall the pinned stage is.
scrollContainerRefObject<HTMLElement>—Drive it from a scrollable element instead of the page.
progressnumber—Set the lift yourself, 0 to 1. Scroll is then ignored.
disabledbooleanfalseDrops the peel: both layers stack as ordinary blocks.
respectReducedMotionbooleantrueStacks the layers when the user asks for less motion.

Dependencies

0 external runtime dependencies

Ships with nothing but React.