Backgrounds

Starfield

Depth-layered stars drifting through a slow warp, each layer parallaxing at its own pace, with the occasional shooting star streaking a bright amethyst tail across the dark before the field settles back to its patient glimmer.

Install

# Starfield needs no npm packages

Then copy 2 files into your project:

  • components/registry/starfield/starfield.tsx
  • hooks/use-animation-loop.ts

Props

PropTypeDefaultDescription
starColorstring (hex)"#ffffff"Color of the star field.
accentColorstring (hex)"#a855f7"Tints a minority of stars and every shooting-star tail.
densitynumber1Star count relative to the pane area.
layersnumber3Parallax depth layers — nearer layers drift faster and brighter.
driftSpeednumber0.5Speed of the slow directional warp across the field.
twinklenumber0.5Strength of per-star brightness twinkle.
shootingStarsnumber0.4How often streaks appear; 0 disables them.
glownumber8Glow blur around each star.

What It Demonstrates

Parallax
Background and foreground move at different speeds while scrolling, creating depth.
Loop
An animation that repeats, a set number of times or infinitely.
Idle animation
Subtle motion that plays while an element is just sitting there, waiting to be interacted with.

Related Components

Appears In