
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.
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
/>Read from the component's own type, so this cannot drift from what it accepts.
| Prop | Type | Default | Description |
|---|---|---|---|
src* | string | — | |
alt* | string | — | |
drift | number | — | How far the photo drifts against the scroll, as a share of the frame height. 0 holds it still. |
reveal | boolean | — | Blur the photo into focus once it has loaded |
priority | boolean | — | Load straight away for photos above the fold |
className | string | — | Sizes and shapes the frame: give it a height or an aspect ratio, plus any radius |
imageClassName | string | — | Additional classes merged onto the image |