Photo Drift

A calm reception lounge with a teal sofa and a stone desk
About this component

Photo Drift

A photograph in a fixed frame that drifts a little slower than the page as it scrolls past, and blurs into focus from a slight zoom once it has loaded. The frame takes any size, ratio and radius from its classes, the drift is one number, and reduced motion holds the photo still.

Usage

The import and the props worth knowing about, in one place.

import { PhotoDrift } from "@/components/beste/component/photo-drift";

<PhotoDrift
  src="https://oud.pics/b/dental/mira-reception.webp"
  alt="A calm reception lounge"
  className="aspect-4/3 w-full rounded-4xl"
  drift={0.08}     // share of the frame height, 0 holds it still
  priority         // above the fold: load straight away
/>

Props

Read from the component's own type, so this cannot drift from what it accepts.

PropTypeDefaultDescription
src*string—
alt*string—
driftnumber—How far the photo drifts against the scroll, as a share of the frame height. 0 holds it still.
revealboolean—Blur the photo into focus once it has loaded
priorityboolean—Load straight away for photos above the fold
classNamestring—Sizes and shapes the frame: give it a height or an aspect ratio, plus any radius
imageClassNamestring—Additional classes merged onto the image

More Media components

View all Media
A clear glass perfume bottle and two small jars casting amber shadows on warm paper
Swimmers seen from above near a rocky shoreline

Low tide

Chet Baker, 2023

A pebble beach curving along a turquoise bay

The long bay

Nina Simone, 2022

Swimmers in a narrow rocky bay below pine trees

Under the pines

Miles Davis, 2024

A deep turquoise inlet between two cliffs

Inlet

Joni Mitchell, 2024

A limestone cove with clear green water

Green water

Bill Evans, 2023

A model in wide striped trousers leaning on a teal wallA glass perfume bottle casting amber shadows on warm paperA woman in a dark check coat walking down a city streetOrange poppies against a clear blue skyA singer with one hand raised in stage smoke and red light
A model in a bright yellow fleece set on a concrete courtA red swing carousel spinning against a pale skyA woman with short hair looking back over her shoulderA dropper bottle of golden oil on a round wooden boardA model in a red jersey and black jacket against a teal sky