A tunnel of photos you glide through
| Name | Type | Default | Description |
|---|---|---|---|
items | { src: string; alt: string; title?: string }[] | built-in scene collection | Photos placed along the walls. Images must allow cross-origin loading. Titles are shown as captions when a photo is opened. |
colors | [string, string] | ["#5227FF", "#FF9FFC"] | The two ends of the gradient used for accent tiles. |
backgroundColor | string | "#0a0a0a" | Colour of the walls and of the distance the tunnel fades into. Grid lines adapt to it. Pass "transparent" to show the page behind. |
lanes | number | 5 | Tiles across the floor and ceiling. The walls get as many as fit the aspect ratio. |
gap | number | 0.1 | Space between tiles as a fraction of a cell. 0 makes tiles flush. |
radius | number | 0.06 | Corner rounding of the tiles, from 0 (square) to 1 (circular). |
photoFill | number | 0.3 | Share of cells holding a photo, from 0 to 1. |
accentFill | number | 0.06 | Share of cells holding a gradient accent tile. |
lineOpacity | number | 0.12 | Opacity of the hairline grid. |
fog | number | 1 | How quickly the tunnel fades into the background with distance. |
speed | number | 0.6 | Cruising speed in cells per second. Negative values travel backwards; 0 stays still. |
boost | number | 10 | Speed multiplier while the pointer is held down. |
blur | number | 1 | Strength of the motion blur at high speed. 0 turns it off. |
look | number | 1 | How far the view turns and shifts toward the pointer. |
fov | number | 72 | Vertical field of view in degrees. Wider angles exaggerate the depth. |
hover | number | 1 | Brightening and lift of the tile under the pointer. 0 turns it off. |
focusOnClick | boolean | true | Clicking a photo flies it out of the wall to full view. Click again or press Escape to put it back. |
captions | boolean | true | Show the title and position of an opened photo. |
wheel | boolean | true | Scroll to travel through the tunnel; scrolling while a photo is open puts it back and moves on. Set false to leave page scrolling untouched. |
interactive | boolean | true | Enable pointer look, dragging, holding and clicking. Drag vertically with a mouse or sideways on touch. |
seed | number | 0 | Changes which cells hold photos and accents. |
paused | boolean | false | Stops cruising. Dragging and holding still work. Reduced-motion users never cruise. |
dpr | number | 2 | Maximum device pixel ratio for the canvas. |
ariaLabel | string | "Photo tunnel…" | Accessible description of the gallery and how to use it. |
onFocusChange | (item, index) => void | — | Called when a photo is opened, with null and -1 when it is put back. |
ref | { close, travel } | — | Imperative controls: put an opened photo back, or give the camera a push of a number of cells. |
children | ReactNode | — | Content centred over the tunnel, such as a headline or call to action. |
className | string | — | Classes for the root element. It fills its parent, with a 420px minimum height. |
style | CSSProperties | — | Inline styles for the root element. |
items{ src: string; alt: string; title?: string }[]Photos placed along the walls. Images must allow cross-origin loading. Titles are shown as captions when a photo is opened.
built-in scene collectioncolors[string, string]The two ends of the gradient used for accent tiles.
["#5227FF", "#FF9FFC"]backgroundColorstringColour of the walls and of the distance the tunnel fades into. Grid lines adapt to it. Pass "transparent" to show the page behind.
"#0a0a0a"lanesnumberTiles across the floor and ceiling. The walls get as many as fit the aspect ratio.
5gapnumberSpace between tiles as a fraction of a cell. 0 makes tiles flush.
0.1radiusnumberCorner rounding of the tiles, from 0 (square) to 1 (circular).
0.06photoFillnumberShare of cells holding a photo, from 0 to 1.
0.3accentFillnumberShare of cells holding a gradient accent tile.
0.06lineOpacitynumberOpacity of the hairline grid.
0.12fognumberHow quickly the tunnel fades into the background with distance.
1speednumberCruising speed in cells per second. Negative values travel backwards; 0 stays still.
0.6boostnumberSpeed multiplier while the pointer is held down.
10blurnumberStrength of the motion blur at high speed. 0 turns it off.
1looknumberHow far the view turns and shifts toward the pointer.
1fovnumberVertical field of view in degrees. Wider angles exaggerate the depth.
72hovernumberBrightening and lift of the tile under the pointer. 0 turns it off.
1focusOnClickbooleanClicking a photo flies it out of the wall to full view. Click again or press Escape to put it back.
truecaptionsbooleanShow the title and position of an opened photo.
truewheelbooleanScroll to travel through the tunnel; scrolling while a photo is open puts it back and moves on. Set false to leave page scrolling untouched.
trueinteractivebooleanEnable pointer look, dragging, holding and clicking. Drag vertically with a mouse or sideways on touch.
trueseednumberChanges which cells hold photos and accents.
0pausedbooleanStops cruising. Dragging and holding still work. Reduced-motion users never cruise.
falsedprnumberMaximum device pixel ratio for the canvas.
2ariaLabelstringAccessible description of the gallery and how to use it.
"Photo tunnel…"onFocusChange(item, index) => voidCalled when a photo is opened, with null and -1 when it is put back.
—ref{ close, travel }Imperative controls: put an opened photo back, or give the camera a push of a number of cells.
—childrenReactNodeContent centred over the tunnel, such as a headline or call to action.
—classNamestringClasses for the root element. It fills its parent, with a 420px minimum height.
—styleCSSPropertiesInline styles for the root element.
—