GodUI

Warp Starfield

A depth starfield you fly through — cursor parallax and an optional hyperspace warp.

Stars stream toward you out of the dark, with the cursor gently steering the field for parallax. Flip on warp for a hyperspace jump where the stars stretch into streaks. Drop it as the first child of a relative container.

Reach the stars

Move your cursor to steer.

Installation

pnpm dlx shadcn@latest add "https://godui.design/r/warp-starfield.json"

Usage

tsx
 
import { WarpStarfield } from "@/components/godui/warp-starfield";

<div className="relative overflow-hidden">
  <WarpStarfield />
  <YourContent />
</div>

The layer is absolute inset-0 z-base; parent must be relative, content at z-raised+. Star color defaults to --color-foreground (tracks light/dark — it reads on light surfaces too). Caps DPR at 2, pauses off-screen and on hidden tabs, and renders a static frame under prefers-reduced-motion.

Examples

Hyperspace

Props

PropTypeDefaultDescription
starCountnumber400Number of stars (auto-scaled to area).
speednumber1Forward speed multiplier.
depthnumber1.5Field depth — larger is deeper.
colorstring--color-foregroundStar color.
warpbooleanfalseHyperspace mode — stars become streaks.
parallaxnumber30Cursor parallax strength (px).

Also accepts standard div attributes (e.g. className, style).

On this page

Built with GodUI

Beautifully crafted motion components for modern interfaces.

Star on GitHub