
Fractal Glass
WebGL
A WebGL starfield background that adds scale and atmospheric depth to AI, space-adjacent, developer-tool, and premium brand heroes.
Milky Way gives the hero scale without weight: a starfield as atmosphere, not spectacle.
Use it for AI, space-adjacent, developer-tool, and premium brand heroes that need atmosphere behind a short claim. The page job is scale: the field should make the statement feel larger without adding visual noise.
The production risk is needless particles. If a static starfield gives the same feeling, ship the still on lower tiers.
import MilkyWay from "@/components/effects/milky-way" const page = () => { return ( <MilkyWay /> )} export default pageA satellite data startup can use Milky Way behind the hero of its homepage. A slowly rotating galaxy of stars and nebula sits behind a short claim about global coverage, and the field tilts gently with the cursor.
The outcome is scale. The statement feels larger without extra copy. The galaxy renders on desktop only, so give the hero its own still image for phones.
Not for low-power-first pages, dense content, dashboards, checkout, or routes where performance is the main conversion lever.
Cap DPR at 1.0 on touch/mobile and up to 1.5 on mid-range desktop. Pause Milky Way offscreen and in hidden tabs, reduce postprocessing before shipping, and keep texture sizes controlled.
Keep meaningful content in HTML outside the canvas. On mobile the component skips the scene and shows an "Open in desktop" message, so supply your own poster for phones.
| Prop | Type | Default | Description |
|---|---|---|---|
particleSize | number | 2 | Particle and nebula point size multiplier. |
numberOfParticles | number | 80000 | Number of star particles in the galaxy. |
coreColor | string | #ffbb00 | Bright inner galaxy and starfield color. |
accentColor | string | #ffffff | Nebula and sparkle accent color. |
outerColor | string | #4400ff | Outer arm and warm sparkle color. |
backgroundColor | string | #000114 | Canvas background color. |
rotation | number | 1.6 | How strongly the galaxy tilts with mouse movement. |
mouseInfluence | boolean | true | Enable cursor-driven galaxy tilt. |
rotationSpeed | number | 0.9 | Speed the particles orbit around the galaxy centre. |
A starfield's cost scales with particle count, so cap DPR at 1.0 on mobile and 1.5 on desktop and reduce the number of stars on smaller devices. Favor cheap point rendering over heavy per-particle shading. Confirm the field stays smooth on a phone before shipping.
Use a static starfield image so the sense of scale survives without the live particles. The hero copy is HTML and reads regardless. A good still keeps the atmosphere intact.
Pause the particle animation when the canvas scrolls away or the tab is hidden, resuming on return. A drifting starfield left running in the background is needless GPU work. Use a visibility check with demand rendering.
Headline, subhead, and CTA stay in the DOM over the field; the stars are ambience, not content. Don't place any message inside the rendered scene. Keep the CTA a real button.
Choose a static field when the motion is purely atmospheric, when targeting mobile, or when the page can't spare the GPU. If a still conveys the same scale, it's the efficient pick. Reserve the live starfield for heroes where the drift adds genuine mood.
Need a custom effect? Tell us what to create.