Skip to main content
A parallax-animated starfield background using layered motion and randomized star positions. This component creates a beautiful depth effect that responds to mouse movement.

Props

Prop NameTypeDefaultDescription
factornumber0.05Multiplier for mouse parallax movement.
speednumber50Base speed (in seconds) for vertical looping animation of star layers.
transitionSpringOptions{ stiffness: 50, damping: 20 }Spring physics config for smooth motion response to cursor movement.
starColorstring"#fff"Color of the stars. Accepts any valid CSS color value.
classstringOptional additional classes for container div. Useful for z-index, etc.
This component wraps a slot for children, so you can place other UI elements over the background.

Credits

Build docs developers (and LLMs) love