Warp Field

Surface study no. 04

Form that refuses to hold still.

A studio for identities that move. We cast brands in liquid metal, then let them settle into something you can hold.

About this component

Warp Field

A Canvas 2D starfield streaming from a vanishing point that leans toward the cursor. Raise the warp prop and the stars ease into long hyperspace streaks while a soft tunnel glow opens; lower it and they settle back to a slow cruise. Space, star and glow colors, density, speed, streak length, glow, horizon and follow are all props. The stars fade in softly on load, the star count adapts to the device, it pauses offscreen and holds a still field for reduced motion.

Usage

The import and the props worth knowing about, in one place.

import { WarpField } from "@/components/beste/component/warp-field";
import { useState } from "react";

// Drive the warp from anything: a button hover, a scroll position, a timer
const [warp, setWarp] = useState(0);

<section className="relative min-h-[40rem]">
  <WarpField className="absolute inset-0" warp={warp} />
  <button
    onPointerEnter={() => setWarp(1)}
    onPointerLeave={() => setWarp(0)}
    className="relative"
  >
    Reserve a seat
  </button>
</section>

<WarpField
  className="min-h-[32rem]"
  spaceColor="#04050a"   // any CSS color, tokens included
  glowColor="#96afff"
  density={0.8}          // more stars, 0 to 1
  streaks={0.7}          // longer streaks at warp
  horizon={0.5}          // vanishing point height
/>

Props

Read from the component's own type, so this cannot drift from what it accepts.

PropTypeDefaultDescription
spaceColorstring—Color of empty space behind the stars. Any CSS color, tokens included.
starColorstring—Color of the nearest, brightest stars.
midColorstring—Color of the middle distance.
farColorstring—Color of the faintest, farthest stars.
glowColorstring—Color of the tunnel glow that opens at warp.
densitynumber—How many stars fill the field, 0 to 1.
speednumber—Cruising speed, 1 is the default pace.
warpnumber—Throttle toward hyperspace, 0 (cruise) to 1 (full warp). Eased, so it can be toggled freely.
streaksnumber—Length of the streaks at warp, 0 to 1.
glownumber—Strength of the tunnel glow at warp, 0 to 1.
horizonnumber—Height of the vanishing point, 0 (top) to 1 (bottom).
interactiveboolean—The vanishing point leans toward the cursor.
follownumber—How far it leans, 0 to 1.
pausedboolean—Freeze the field where it is.
classNamestring—
childrenReactNode—

More Background components

View all Background