Skip to Content
zjkm-ui
Components

Warp Tunnel

A tunnel of light rushing past.

ProPro, coming soon.

Ship at light speed

Props
400
1.0
<WarpTunnel>
  <Hero />
</WarpTunnel>

Get notified

Warp Tunnel is a Pro effect. Join the waitlist and we'll email you when it's available.

Usage

Stars rush out of a vanishing point at the centre, stretching into streaks as they pass. It draws on a canvas, and the drawing stops while it's off-screen or the tab is hidden. Without canvas support, your content shows on its own.

import { WarpTunnel } from "@zjkm/pro/warp-tunnel";

export function Hero() {
  return (
    <WarpTunnel className="rounded-2xl bg-black p-16">
      <h1 className="text-white">Ship at light speed</h1>
    </WarpTunnel>
  );
}

Props

PropTypeDefaultDescription
childrenReactNodeContent shown over the tunnel.
colorstring"#ffffff"Star colour.
countnumber400Number of stars.
speednumber1Travel speed.
classNamestringClasses for the wrapper.

With reduced motion, the stars stay still as points.

On this page