Mediastable
Lenticular
Two-image lens flip
Two pictures interlaced under one lens, swapping as you move across it.
On a touch screen a tap or a sideways drag scrubs the print; vertical scrolling still works.
Customize
Printmove across it and the picture underneath takes over
46
strips7 °
tilt0.50
sheen16 px
radiusUsage
import { Lenticular } from "zerogravity/lenticular"
<Lenticular
frontSrc="/day.jpg"
backSrc="/night.jpg"
alt="The same street by day and by night"
/>Generated from the controls above. Only props that differ from their defaults are shown.
Props
| Property | Type | Default | Description |
|---|---|---|---|
strips | number | 46 | Strips. Range 10 to 120. |
tilt | number | 7 | Tilt. Range 0 to 20 °. |
sheen | number | 0.5 | Sheen. Range 0 to 1. |
radius | number | 16 | Radius. Range 0 to 48 px. |
frontSrc | string | — | The image seen from the left. |
backSrc | string | — | The image seen from the right. |
alt | string | — | Describes the pair; one card, one description. |
position | number | — | Holds the print at a position, 0 to 1, and ignores the pointer. |
aspect | string | "4 / 3" | Locks the card to a ratio. |
objectPosition | string | "50% 50%" | Where both pictures sit when cropped. |
disabled | boolean | false | Holds the print head-on, both pictures interlaced. |
respectReducedMotion | boolean | true | Under prefers-reduced-motion, no tilt or easing: the swap follows the pointer directly. |
Dependencies
0 external runtime dependencies
Ships with nothing but React.