Wrap the layers in a Parallax root. Give each ParallaxLayer a speed.
trip-hero.tsx
Parallax
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| range | "page""pin""view" | — | Where the scroll source counts from: view (default, the item's own pass through the view), page (the page scroll from its top, for a hero), or pin (the px a tall section with a sticky stage has pinned). See PARALLAX_RANGES. |
| axis | "x""y" | — | The scroll axis: y (default) or x. |
| offset | ParallaxOffset | — | The start and the end of a view range in Motion's offset words (["start 0.9", "end 0.55"]). Default PARALLAX_FULL_PASS: the whole pass through the view. |
| anchor | number | — | The progress of the view range where every layer is at rest, from 0 to 1. Default 0.5: the middle of the range (the middle of the item at the middle of the view for the whole pass). |
| finish | boolean | — | A view range that the end of the page cuts short ends at the end of the scroll, so an item near the bottom of the page still reaches progress 1. Default false. |
| container | RefObject<HTMLElement | null> | — | The scroll box, when the item scrolls inside one and not with the page. |
| pointer | boolean | — | Adds the pointer source: the layers drift toward the mouse over the item. Default false. |
| pointer | "element""page" | — | Where the pointer counts: over the item (element, default) or the whole page (page). |
| disabled | boolean | false | Rests every layer and stops the work. |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
ParallaxLayer
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| speed | number | 1 | How fast the layer moves against the scroll, as a multiplier of the designed pace (1, the default: 20% faster than the page). 1.5 looks nearer, a negative value lags and looks farther, 0 keeps it with the page. |
| depth | number | 0 | How far the layer drifts toward the mouse at the edge of the root, in px, with pointer on the root. A negative depth drifts away from the mouse (a far layer). Default 0. |
| limit | number | — | The largest scroll offset in px on each side. Give it to a layer in a clipped box (a picture that is 80px larger than its frame: 40), so its edge never shows. |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |







