Skip to content

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.json

Usage

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

PropTypeDefaultDescription
densitynumber1Star count multiplier (1 ≈ 130k). Use ~0.4 for small canvases or low-end devices.
backgroundstring"#1f1f1f"Sky color behind the stars.
interactivebooleantrueStars brighten along the cursor's path.
dithernumber1Ordered Bayer dither amount, 0–1.
bloomnumber0.2Bloom strength; fades in after the first frames.
classNamestring—The canvas fills its nearest positioned ancestor.

Credits

This component is built on top of three.js.