Scrollstable
Gantry
Horizontal scroll rail
A rail of cards that travels sideways while the page scrolls down.
01/06Stop
Rail
02/06Stop
Truss
03/06Stop
Span
04/06Stop
Crane
05/06Stop
Beam
06/06Stop
Hoist
Customize
Railvertical scroll drives horizontal travel
320px
itemWidth24px
gap6 °
leanTiminghow the scroll is shared between rests and moves
0.70
pace0.55
transition0.40
holdeasingUsage
import { Gantry } from "zerogravity/gantry"
<Gantry>
<Card />
</Gantry>Generated from the controls above. Only props that differ from their defaults are shown.
Props
| Property | Type | Default | Description |
|---|---|---|---|
itemWidth | string | "320px" | Card width. Range 160 to 520 px. |
gap | string | "24px" | Gap. Range 0 to 64 px. |
lean | number | 6 | Lean. Range 0 to 24 °. |
pace | number | 0.7 | Scroll per card. Range 0.2 to 3. |
transition | number | 0.55 | Share spent moving. Range 0.1 to 1. |
hold | number | 0.4 | Hold the last card. Range 0 to 2. |
easing | "smooth" | "linear" | "smooth" | Easing. |
children | ReactNode | — | One card per stop along the rail. |
height | string | "80vh" | How tall the pinned stage is. |
label | string | "Horizontal gallery" | Names the rail once reduced motion turns it into a scroller. |
onProgress | (progress: number) => void | — | Called with 0 to 1 as the rail travels. |
progress | number | — | Set the rail position yourself, 0 to 1. Scroll is then ignored. |
Dependencies
0 external runtime dependencies
Ships with nothing but React.