Skip to content

Components / Backgrounds

Hyperspeed

Draws a jump to light speed: streaks of light rush out of a vanishing point, longer and brighter toward the edge, in one colour with a hot head in a second tone. Three layers of angular sectors on the GPU, each streak at its own pace; the vanishing point leans toward the pointer, and holding the pointer down on the host (or Space or Enter while the host itself has focus) punches the drive: streaks stretch and the rush speeds up, easing back on release. Every constant is a custom property re-read when the element's style changes. Without WebGL2 or JavaScript a still starburst stands in. Fills its positioned parent.

Live demo

Hyperspeed.

hold to jump

Live, from the library itself: scroll, hover, navigate away and back. The demo is never gated.

Measured

JavaScript with its libs

11.1 kB raw

1.5 kB raw of its own, 928 B gzip. The rest is the runtime, the shader runner, the canvas helper and the GL core, loaded once for every effect on the page.

CSS 5.1 kB raw including the base tokens. Measured from a production build, and again in CI for every change that can move it.

Browser support

Baseline · widely available

Chrome 56 · Firefox 51 · Safari 15; needs webgl2. Elsewhere: without WebGL2, a still starburst in the colour.

Install Pro

The demo above is never gated; the source is. With a key in components.json (see account), the registry serves it like any other item:

terminal
npx shadcn@latest add @moonarc-pro/hyperspeed
src/pages/index.astro
<section class="relative min-h-[60vh] bg-black text-white">
  <Hyperspeed color="oklch(0.72 0.14 230)" />
  <h1 class="relative">Hold to jump.</h1>
</section>

Without a key the registry answers 401 with an upgrade message. Related free primitives: meteors.

Props

PropTypeDefaultDescription
colorstring'oklch(0.72 0.14 230)'Streak colour; any CSS colour, theme tokens included.
headstringcolor lifted 60 % toward whiteThe colour of a streak's leading end.
densitynumber90Angular sectors in the first layer; each layer adds more.
speednumber1Rush speed multiplier.
streaknumber1Streak length multiplier.
widthnumber1.6Streak width in CSS px at the edge.
boostnumber4How much faster the drive runs while held; 0 disables the hold.

Reduced motion

No loop: one frame of streaks at a fixed moment; holding does nothing.

With ClientRouter

Bound through the shared runtime: loop, observers and pointer listener are released before the swap and the WebGL context is lost on purpose after it; five round trips leave one context. Under transition:persist the canvas keeps its context and starts again on the next page.

Why it is built this way

Replaces: Hyperspeed (React Bits) · Warp / starfield backgrounds. See the migration table.

Meteors

Backgrounds

Streaks falling diagonally across a twinkling sky.

every browseralways

Draws slow noise waves on the GPU, ordered-dithered into pixel cells of one colour on the page's ground, for the look of a 1-bit screen.

every browseralwayspointer

Moves thousands of particles along an invisible current, leaving fading trails.

every browseralwayspointer

Draws glowing ribbons of light drifting through each other: four sine fields interfere on the GPU, the sum folds into soft bands, and each band glows in a colour sliding between two tones with a hot core at its peak.

every browseralwayspointer

Also: view transitions · how costs are measured · browser support · accessibility policy · five-minute setup · MCP for agents · this page as Markdown