Galaxy
A WebGPU night sky of ~130k twinkling stars with Milky Way bands, a cursor-wake glow, ordered dithering and bloom.
2 variantsNew
Preview
Installation
Copies the component into components/ui and installs its dependencies and theme tokens.
pnpm dlx shadcn@latest https://floret.shippedui.com/r/galaxy.jsonUsage
Pass your own data and wire the callbacks to your app.
import { Galaxy } from "@/components/ui/galaxy";
<section className="relative isolate h-[70vh] overflow-hidden">
<Galaxy background="#0b0b0d" />
<h1 className="relative z-10">Ship among the stars</h1>
</section>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| density | number | 1 | Star count multiplier (1 ≈ 130k). Use ~0.4 for small canvases or low-end devices. |
| background | string | "#1f1f1f" | Sky color behind the stars. |
| interactive | boolean | true | Stars brighten along the cursor's path. |
| dither | number | 1 | Ordered Bayer dither amount, 0–1. |
| bloom | number | 0.2 | Bloom strength; fades in after the first frames. |
| className | string | — | The canvas fills its nearest positioned ancestor. |
Credits
This component is built on top of three.js.