Component packs › Darkroom › Depth Tilt

Depth Tilt

One flat photo becomes two layers that slide apart on springs as you move or tilt the phone, the shadow shifting the other way.

Depth Tilt is a parallax from Darkroom, a component pack with 7 effects: Seven photo effects that work on real photos, not on drawings of them. Price: $2 for the whole pack.

Built with: two layers from one photo, spring parallax, device tilt.

Code: React and Next.js (TypeScript), Vue 3, plain HTML/CSS/JS, Tailwind CSS v4 and Motion (motion.dev). No npm packages needed. Keyboard accessible, with a reduced-motion version, in dark and light.

Depth Tilt props

PropTypeDefaultDescription
lightboolean
autoplayboolean
srcstring
depthnumberHow far the near layer moves, in px at the edge.

Methods on the ref

Use it in React

import DepthTilt from './DepthTilt';

<DepthTilt />

The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.

More in Darkroom

Good for: Image effect components.