Scrollstable
Eclipse
Covering sections
Each section pins, and the next one slides over it until nothing is left.
01
One
02
Two
03
Three
04
Four
Scaled to the frame so the whole takeover is visible here. On a page each section is a full viewport.
Customize
Covereach section pins, then the next one slides over it
from0.060
recede0.45
dim0 px
blurUsage
import { Eclipse } from "zerogravity/eclipse"
<Eclipse>
<EclipseSection>One</EclipseSection>
</Eclipse>Generated from the controls above. Only props that differ from their defaults are shown.
Props
| Property | Type | Default | Description |
|---|---|---|---|
from | "up" | "left" | "right" | "up" | Arrives from. |
recede | number | 0.06 | Recede. Range 0 to 0.2. |
dim | number | 0.45 | Dim. Range 0 to 1. |
blur | number | 0 | Blur. Range 0 to 12 px. |
children | ReactNode | — | One `EclipseSection` per panel. Order is the cover order. |
height | string | "100vh" | How long each section stays pinned. |
scrollContainer | RefObject<HTMLElement> | — | Drive it from a scrollable element instead of the page. |
disabled | boolean | false | Drops the pinning entirely: sections simply follow one another. |
onActiveChange | (index: number) => void | — | Called when the section in view changes, not on every frame. |
Dependencies
0 external runtime dependencies
Ships with nothing but React.