---
title: "Parallax Image"
description: "A framed picture that moves slower than the page and never shows its edge. Text can sit on top."
url: https://gelatinui.com/components/parallax-image
markdown_url: https://gelatinui.com/components/parallax-image.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/parallax-image"
version: "2026-11-10"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Parallax Image

> A framed picture that moves slower than the page and never shows its edge. Text can sit on top.

Page: https://gelatinui.com/components/parallax-image

## When to use it

Best for: One framed photo in a page that moves a little slower than the text around it.

- Give `src`, `alt`, and the file `width` and `height`, so the frame keeps the ratio before the file loads.
- Set the frame ratio with an `aspect-*` class when the frame must differ from the file. The class wins.
- Raise `overscan` for a stronger move, and add a small `zoom` (0.05 to 0.12) for a slow settle.
- Put text over the picture as `children`: it fills the frame and stays still.

## When not to use it

- For a picture that does not move, use an [Image](https://gelatinui.com/components/image.md).
- For a scene of several moving layers, use [Parallax](https://gelatinui.com/components/parallax.md).

## Notes for agents

- The picture layer is `overscan` taller than the frame on each side and travels the whole margin over its pass, so its edge never shows.
- With no `aspect-*` class and no `width` and `height`, the frame is 16:9.
- `zoom` below 0 counts as 0.
- `disabled` rests the picture at the middle of its margin.
- It moves with `transform` only, and the work stops off screen.

## Anatomy

```text
ParallaxImage
```

## API reference

### ParallaxImage

| 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. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| ParallaxImage | `parallax-image` |  | `--parallax-image-ratio` |  |

## Usage

Give the picture and its file size. Put text over it as children.

```tsx title="trail-photo.tsx"
import { ParallaxImage } from "@/components/pro/effects/parallax-image";

export function TrailPhoto() {
  return (
    <ParallaxImage
      src="/misty-hills.webp"
      alt="Misty blue hills at sunrise"
      width={1600}
      height={1067}
    />
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui-pro/parallax-image
```

It adds 30 registry items: 28 files, 5142 lines, and the npm packages `@base-ui/react`, `@mantine/hooks`, `@phosphor-icons/react`, `@unpic/core`, `@xstate/react`, `clsx`, `motion`, `tailwind-merge`, `tailwind-variants`, `xstate`.

## Built on

- [Image](https://gelatinui.com/components/image.md)
- [Parallax](https://gelatinui.com/components/parallax.md)

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Image](https://gelatinui.com/components/image.md)
- [Parallax](https://gelatinui.com/components/parallax.md)
- [Tilt](https://gelatinui.com/components/tilt.md)

## Accessibility

The picture keeps its `alt`. Pass `alt=""` for a picture that only decorates.

Text in `children` stays in the reading order after the picture and does not move.

## Motion

| Part | Motion |
| --- | --- |
| Scroll | none · the picture follows the scroll in the same frame, with no easing |
