Skip to content

Parallax

Free

Layers that move at their own speed as the page scrolls, and drift toward the mouse. Use it for a hero, a framed picture, or a layer of your own.

  • Base UI
  • Motion
  • React 19
  • Tailwind CSS 4

Added Nov 10, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

Wrap the layers in a Parallax root. Give each ParallaxLayer a speed.

trip-hero.tsx

Parallax

<div>
PropTypeDefaultDescription
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.
offsetParallaxOffset—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.
anchornumber—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).
finishAtEndboolean—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.
containerRefObject<HTMLElement | null>—The scroll box, when the item scrolls inside one and not with the page.
pointerboolean—Adds the pointer source: the layers drift toward the mouse over the item. Default false.
pointerArea"element""page"—Where the pointer counts: over the item (element, default) or the whole page (page).
disabledbooleanfalseRests every layer and stops the work.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

ParallaxLayer

<div>
PropTypeDefaultDescription
speednumber1How 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.
depthnumber0How 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.
limitnumber—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.
  • Put ParallaxLayer parts in a Parallax root. speed sets how fast each one moves: above 0 runs ahead (near), below 0 lags (far).
  • Use range="page" for a hero at the top of the page, so every layer is at rest when the page loads.
  • Give a layer in a clipped frame a limit in px, and make it that much larger than the frame, so its edge never shows.
  • Add pointer to the root and a depth to each layer for a drift toward the mouse.
  • For one framed photo that moves slower than the page, use a Parallax Image.
  • For a card that turns toward the mouse, use a Tilt.
  • For a part that pulls toward the mouse, use a Magnetic.

Decoration only: it adds no role, no name, and no focus stop. The layers keep the roles, focus, and clicks of their content.

The layers move with transform only, so the reading order and the layout never change.

Scroll layers
none · each layer follows the scroll in the same frame, with no easing
Pointer drift
drift · a soft spring (stiffness 121, damping 22) to each new mouse place, and home when it leaves
  1. AddedParallax.
Open the release