Give the picture and its file size. Put text over it as children.
trail-photo.tsx
ParallaxImage
<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. |
| container | RefObject<HTMLElement | null> | — | The scroll box, when the item scrolls inside one and not with the page. |
| disabled | boolean | — | Rests every layer and stops the work. |
| src | string | — | The picture file. |
| alt | string | — | Say what the picture shows. "" for a picture that only decorates. |
| width | number | — | The real size of the file in px. With both, the frame takes its ratio before it loads. |
| height | number | — | |
| sizes | string | — | The sizes of the srcset (see Image). |
| preload | boolean | false | Loads at once with a high priority: a picture above the fold. Default false (lazy). |
| overscan | number | 0.15 | How much taller the picture is than the frame, on each side, as a share of the frame height: 0.15 (default) adds 15% above and below. The picture travels this whole margin over its pass, so a larger overscan is a stronger parallax, and the edge never shows. |
| zoom | number | 0 | Extra scale at both ends of the pass: 0.1 starts at 110% and settles to 100% at the middle. Default 0. A value below 0 counts as 0: a picture smaller than its frame shows its edge. |
| children | ReactNode | — | Content over the picture (a caption, a heading). It fills the frame; place it with classes. |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
Built with
Installs with Parallax Image











