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 waitlistPlayground
Move cursor over canvas to interact
Color Mode
Camera steering
Install
npm install @shavin/fximport { 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
| Prop | Type | Default | Description |
|---|---|---|---|
| colors | FxPalette: "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. |
| leftColors | string[] | — | Exact colours for the left-lane streaks (taillights); overrides colors for that lane. |
| rightColors | string[] | — | 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 / rightColor | string | — | Deprecated: use colors={[left, right]}, or leftColors / rightColors. |
| speed | number | 2.5 | Travel speed multiplier. |
| streakCount | number | 200 | Number of light streaks. |
| curvature | number | 1.2 | How much the road bends (0 is a straight road). |
| fov | number | 120 | Perspective factor of the camera. |
| streakLength | number | 600 | Base length of each streak's tail. |
| interactive | boolean | true | Pointer height tilts the camera and press-and-hold speeds up travel (mouse, touch and pen). The tilt is ignored under reduced motion. |
| grain | number | 0 | Film grain over the canvas, 0 to 0.3 (0 is off). |