Lens Drift Grid
A seamless two-axis image wall warped as one continuous fisheye surface, with dense editorial tiles, weighted drag navigation, and a gentle idle auto-drift that yields to touch.
Installation#
pnpm dlx shadcn@latest add @davinciui/lens-drift-gridUsage#
API Reference#
| Prop | Type | Default |
|---|---|---|
itemsImages and labels repeated across the seamless two-axis grid. | LensDriftItem[] | Built-in editorial motion collection |
tileWidthWidth of each gallery tile in CSS pixels. | number | 238 |
tileHeightHeight of each gallery tile in CSS pixels. | number | 272 |
gapSpace between adjacent grid tiles in CSS pixels. | number | 0 |
lensStrengthIntensity of the center-weighted bend. Use 0 for a flat grid. | number | 0.24 |
themeColor treatment for the grid surface, tile chrome, labels, and depth vignette. System follows the active page or OS theme. | "dark" | "light" | "system" | "system" |
hoverNudgeDistance of the small reversible motion shown when a mouse enters the grid. | number | 16 |
inertiaMomentum retained after drag release. Values are clamped between 0 and 0.98. | number | 0.94 |
wheelSensitivityTrackpad and mouse-wheel response. Lower values create a slower, heavier pan. | number | 0.42 |
autoDriftSlow idle self-motion in px/sec. True uses a gentle diagonal drift. Pauses on interaction and resumes after driftResumeMs. Ignored under reduced motion. | boolean | { x?: number; y?: number } | false |
driftResumeMsStillness in milliseconds after interaction before auto-drift resumes. | number | 2400 |
interactiveWhen false, hover, drag, wheel, and keyboard input are disabled and only autoDrift drives the animation. Use for ambient auto-playing previews. | boolean | true |
classNameAdditional classes applied to the root container. | string | — |
Accessibility#
The root is a labelled region, focusable when interactive, with arrow-key panning and a screen-reader instruction. The canvas is aria-hidden, so individual images, titles, and alt text are not exposed to assistive technology.
Motion#
Drag inertia, wheel panning, hover nudge, keyboard steps, and optional autoDrift animate the WebGL grid; inertia, wheelSensitivity, hoverNudge, autoDrift, and driftResumeMs control response. prefers-reduced-motion stops inertia, hover nudge, and autoDrift, while drag and arrow keys still redraw.
View source
Keep in mind
Need a custom component?
I build bespoke UI components & websites tailored to your brand.

