ZeroGravity UI

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
scrolls inside this frame

Customize

Railvertical scroll drives horizontal travel
320pxitemWidth
24pxgap
6 °lean
Timinghow the scroll is shared between rests and moves
0.70pace
0.55transition
0.40hold
easing

Usage

TSX
import { Gantry } from "zerogravity/gantry"

<Gantry>
    <Card />
</Gantry>

Generated from the controls above. Only props that differ from their defaults are shown.

Props

12 documented props on Gantry
PropertyTypeDefaultDescription
itemWidthstring"320px"Card width. Range 160 to 520 px.
gapstring"24px"Gap. Range 0 to 64 px.
leannumber6Lean. Range 0 to 24 °.
pacenumber0.7Scroll per card. Range 0.2 to 3.
transitionnumber0.55Share spent moving. Range 0.1 to 1.
holdnumber0.4Hold the last card. Range 0 to 2.
easing"smooth" | "linear""smooth"Easing.
childrenReactNode—One card per stop along the rail.
heightstring"80vh"How tall the pinned stage is.
labelstring"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.
progressnumber—Set the rail position yourself, 0 to 1. Scroll is then ignored.

Dependencies

0 external runtime dependencies

Ships with nothing but React.