BackgroundsNew

Gravity Stars

A starfield on canvas. Stars twinkle, link up with lines and gather toward the cursor.

Customize

color

Based on Gravity Stars (MIT license) ยท Terms of use

More in Pro

View all

Props

14 properties
PropertyTypeDefaultDescription
countnumber220Number of stars. Fewer on narrow screens.
gravitynumber1Pull strength toward the cursor.
connectbooleantrueThin lines between nearby stars.
connectDistancenumber130Distance at which stars link up, in pixels.
starSizenumber1.5Star size in pixels.
glownumber5.5Halo around a star. 1 is none, 8 is a bloom.
twinklenumber0.55Twinkle, from 0 to 1.
speednumber1Drift speed.
dragnumber0.03Friction. 0 is none, 1 freezes the stars.
colorstring"#ffffff"Star color.
tintnumber0Spread of star tints from cool to warm, from 0 to 1.
pausedbooleanfalsePause the animation.
childrenReactNodeโ€”Content on top of the background, such as a heading.
classNamestringโ€”Classes for the wrapper.

Dependencies

3 required packages

npm install motion clsx tailwind-merge

Related components

View all