Jelly Stars

ProBackgrounds3DWebGLpowered by @vectorvesper/motion

A background of gummy 3D stars that fall from just in front of the camera onto the page, land, wobble like jelly and settle into a pile. A click drops a few more where you click.

Jelly Stars

Included with membership

Members install Jelly Stars with one command and get the full source, the usage code and the Framer remix, licensed for client work. One membership covers the whole library and the CLI.

When to use it

A playful hero, a launch or a celebration page. The page colour and the stars' colours are yours to set.

  • Give it a height, usually the screen's, with style or className.
  • Set background to your page colour, so the stars' reflections match it.

Avoid:

  • Do not put two on one page. Each draws a full scene with shadows.

Props

A background of gummy 3D stars that fall from just in front of the camera onto the page, land, wobble like jelly and settle into a pile. A click drops a few more where you click.

<JellyStars />

A background of gummy 3D stars that fall from just in front of the camera onto the page, land, wobble like jelly and settle into a pile.

PropTypeDefaultDescription
countnumber36Stars in the first shower.
perClicknumber6Stars each click adds.
colorsstring[]seven pastelsThe colours each new star is picked from, as hex, rgb(), hsl() or a colour name.
backgroundstring"#eec9c6"The page colour behind the stars. The stars' reflections keep the first colour given.
sizenumber1Star size multiplier.
wobblenumber1How much a star wobbles when it lands, 0 to 2.
gravitynumber1How hard the stars fall, as a multiple of their own weight.
interactivebooleantrueWhether a click drops more stars.
shadowsbooleantrueWhether the stars cast soft shadows on the page. Off draws less. Read when the scene is built.
classNamestring—Class for the outer element, which the stars fill.
styleReact.CSSProperties—Styles for the outer element, applied after its own, so a height or `position: absolute` set here wins.
childrenReact.ReactNode—Content laid over the stars. A click on it drops stars too.
Visitors who prefer reduced motion get a still in place of the moving scene. Devices below the runtime's floor get the same.
It runs on the shared frame loop, and the runtime lowers the resolution when frames run long. It stops drawing while it is off screen.
Client component. The server renders the box and anything inside it, and the scene is built in the browser.
Back to all components