Skip to content

Hyperspeed

Pro effect

Most Shavin FX effects are free. This one is part of Shavin FX Pro, in early access. Join the Pro waitlist and we will email you once when access opens. You can preview it here in the meantime.

Join the FX Pro waitlist

Playground

Move cursor over canvas to interact

Color Mode

Camera steering

Install

npm install @shavin/fx
import { Hyperspeed } from "@shavin/fx";

Works with

React

Client component; Next.js and any React 18+ app

Remotion

Live pages only; runs on its own clock

Anatomy

import { Hyperspeed } from "@shavin/fx";

<div className="relative w-full h-80 rounded-[var(--radius-panel)] overflow-hidden bg-canvas">
  <Hyperspeed
    colors="theme"
    speed={2.5}
    streakCount={200}
    curvature={1.2}
    fov={120}
    streakLength={600}
    interactive={true}
    className="w-full h-full"
  />
</div>

Examples

Theme palette

colors="theme": brand-coloured taillights in the left lane and white headlights in the right.

Component Source
<div className="relative w-full h-64 rounded-[var(--radius-panel)] overflow-hidden border border-hairline bg-canvas">
  <Hyperspeed
    colors="theme"
    speed={2.5}
    streakCount={200}
    curvature={1.2}
    fov={120}
    streakLength={600}
    interactive={true}
    className="w-full h-full"
  />
</div>

Custom lane colours

An array of two base colours, left lane then right. Each is spread into a ramp for its lane.

Component Source
<div className="relative w-full h-64 rounded-[var(--radius-panel)] overflow-hidden border border-hairline bg-canvas">
  <Hyperspeed
    colors={["#f43f5e", "#06b6d4"]}
    speed={2.8}
    streakCount={220}
    curvature={1.4}
    fov={120}
    streakLength={650}
    interactive={true}
    className="w-full h-full"
  />
</div>

Props

PropTypeDefaultDescription
colorsFxPalette: "native" | "theme" | "brand-dark" | "brand-light" | string[] | { light: string[]; dark: string[] }"native""native": red taillights and white headlights, like a real road; "theme": your brand for the taillights, white headlights; "brand-dark" / "brand-light": the brand forced to one side; an array is [leftBase, rightBase], each spread into a lane ramp.
leftColorsstring[]—Exact colours for the left-lane streaks (taillights); overrides colors for that lane.
rightColorsstring[]—Exact colours for the right-lane streaks (headlights); overrides colors for that lane.
colorMode"native" | "theme" | "custom"—Deprecated: use colors (colorMode="theme" is colors="theme"; "native" and "custom" are the default).
leftColor / rightColorstring—Deprecated: use colors={[left, right]}, or leftColors / rightColors.
speednumber2.5Travel speed multiplier.
streakCountnumber200Number of light streaks.
curvaturenumber1.2How much the road bends (0 is a straight road).
fovnumber120Perspective factor of the camera.
streakLengthnumber600Base length of each streak's tail.
interactivebooleantruePointer height tilts the camera and press-and-hold speeds up travel (mouse, touch and pen). The tilt is ignored under reduced motion.
grainnumber0Film grain over the canvas, 0 to 0.3 (0 is off).
Configure Theme
Theme
Brand Color
Custom
Gray Family
Appearance
Radius
Scaling
Panel Style
Heading Font
Body Font