Kinetic UI
Back to Introduction
Scrollytelling

Tunnel Scroll

A 3D scrollytelling wrapper that turns standard HTML into floating billboards inside a WebGL tunnel.

Quick Actions
CLI Installation
npx kinetic-ui-cli@latest add tunnel-scroll

The TunnelScroll component acts as an immersive page wrapper. Instead of the page scrolling down normally, the component maps your scroll progress to the Z-axis of a 3D camera.

It wraps your standard React children inside @react-three/drei's <Html> projection, rendering them as standard DOM elements that live physically inside the 3D space of the tunnel!

Live Preview

tunnel-scroll-demo
Scroll Down

[!IMPORTANT] Fixed Widths: Because the children are projected into 3D space, standard CSS responsive behaviors (like w-full expanding infinitely) can break the projection and cause the elements to size incorrectly. Always provide fixed maximum widths (e.g., w-[800px] or w-[1000px]) to the top-level children you pass into the wrapper.

Usage Guide

1. Import the Component

Import the component into your React or Next.js page:

import { TunnelScroll } from "@/components/creative/tunnel-scroll";

2. Implementation Example

Render the component and customize its behavior by passing props:

import { TunnelScroll } from "@/components/creative/tunnel-scroll";

export default function Example() {
  return (
    <div className="w-full flex items-center justify-center p-8">
      <TunnelScroll
        spacing{10}
        tunnelColor="example"
      >
        <div>Content goes here</div>
      </TunnelScroll>
    </div>
  );
}
Performance Notes
  • Uses CSS hardware acceleration via GPU transform-binds.
  • Damped interpolation minimizes paint-redraw flashes.
  • Tree-shakable import: only compiles elements requested.
Accessibility Notes
  • Full keyboard focus-ring navigation support (`Tab`/`Shift+Tab`).
  • ARIA roles mapped correctly for assistive screen readers.
  • Respects `prefers-reduced-motion` system toggles.