ZeroGravity UI

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
46strips
7 °tilt
0.50sheen
16 pxradius

Usage

TSX
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

12 documented props on Lenticular
PropertyTypeDefaultDescription
stripsnumber46Strips. Range 10 to 120.
tiltnumber7Tilt. Range 0 to 20 °.
sheennumber0.5Sheen. Range 0 to 1.
radiusnumber16Radius. Range 0 to 48 px.
frontSrcstring—The image seen from the left.
backSrcstring—The image seen from the right.
altstring—Describes the pair; one card, one description.
positionnumber—Holds the print at a position, 0 to 1, and ignores the pointer.
aspectstring"4 / 3"Locks the card to a ratio.
objectPositionstring"50% 50%"Where both pictures sit when cropped.
disabledbooleanfalseHolds the print head-on, both pictures interlaced.
respectReducedMotionbooleantrueUnder prefers-reduced-motion, no tilt or easing: the swap follows the pointer directly.

Dependencies

0 external runtime dependencies

Ships with nothing but React.