3D Flow Gallery
An infinite tunnel built from image panels and a hairline grid. Wheel, drag, or auto-flow streams the rings toward the camera with no roll or horizon line. Light and dark themes are supported.
Installation#
pnpm dlx shadcn@latest add @davinciui/3d-flow-galleryUsage#
Place the gallery in a full-viewport container. Panels cycle through the image list, so six photographs are enough to fill the default 32-ring loop. Wheel input is owned by the gallery while the pointer is over it; pass wheelSensitivity={0} for embedded previews that should let the page scroll. The tunnel follows the site theme by default; pass theme="light" or theme="dark" to pin it.
API Reference#
| Prop | Type | Default |
|---|---|---|
imagesImage sources cycled through the filled slots. The default list uses six portraits. | string[] | — |
tunnelRadiusRadius of the cylindrical tunnel wall in world units. | number | 20 |
ringCountNumber of ring segments in the loop. Rounded up to an even number so the checkerboard stays aligned. | number | 32 |
ringSpacingDistance between adjacent rings along Z. Also sets the panel length. | number | 20 |
panelsPerRingFilled image panels per ring. The ring has twice as many 36° slots. | number | 5 |
fovPerspective camera field of view in degrees. | number | 60 |
autoSpeedAutomatic flow toward the camera in world units per second. Disabled under prefers-reduced-motion. | number | 2 |
wheelSensitivityWorld units added per pixel of wheel delta. Set to 0 to let the page scroll. | number | 0.02 |
dragSensitivityWorld units removed per pixel of vertical drag. Release adds inertia. | number | 0.05 |
themeColour scheme for the tunnel. `system` follows the site's dark class or prefers-color-scheme. | "light" | "dark" | "system" | "system" |
backgroundColorScene and canvas clear colour. Defaults to the active theme background. | string | "#ffffff" / "#080808" |
gridColorHairline grid colour, drawn at 90% opacity. Defaults to the active theme grid colour. | string | "#555555" / "#8a8a8a" |
borderRadiusCorner radius of the clipping surface in pixels. | number | 12 |
ariaLabelAccessible name for the canvas host. | string | "3D flow gallery" |
classNameAdditional classes for the root element. | string | — |
Accessibility#
The host is exposed as a labelled role='img' and the generated canvas is not focusable, so the tunnel adds no keyboard surface. Wheel and drag are pointer-only and have no keyboard equivalent; the image panels are decorative and are not announced individually.
Motion#
A single flow scalar advances at autoSpeed world units per second, wheel adds deltaY × wheelSensitivity, and vertical drag subtracts dy × dragSensitivity. Release carries velocity that decays by 0.92 per 60fps frame, and a 0.1-per-frame lerp smooths the rendered position. The loop pauses offscreen and on hidden tabs; prefers-reduced-motion disables auto-flow but leaves wheel and drag active.
View source
Keep in mind
Need a custom component?
I build bespoke UI components & websites tailored to your brand.

