Constellation
Drifting nodes linked by distance-faded lines, accelerated with a spatial hash. The pointer wires itself into the network and attracts (or repels) nearby stars; clicks blast them apart.
canvasparticlespointerclick5 files · 451 locdeps: clsx, tailwind-merge
Installation
With the shadcn CLI, pointing at this platform’s registry:
npx shadcn@latest add https://opusui.131199999.xyz/r/constellation.jsonOr offline, straight from your opus55 checkout (copies every file it needs):
node ../tailwind_component/opus55/scripts/add.mjs constellationUsage
import { Constellation } from "@/components/opus/backgrounds/constellation";
<Constellation className="absolute inset-0" />API
| Prop | Type | Default | Description |
|---|---|---|---|
| color / accent | string | — | Network colour and pointer-link colour. |
| density | number | 1 | Nodes per 10,000 px² (capped at 400). |
| linkDistance | number | 120 | Max link length (px). |
| speed | number | 1 | Cruise speed. |
| mode | "attract" | "repel" | "none" | "attract" | Pointer force. |
| interactive | boolean | true | React to the pointer (tracked on window). |
| className | string | — | Wrapper classes — `absolute inset-0` to fill a relative parent. |
| children | ReactNode | — | Optional content rendered above the canvas. |
Notes
- Canvas 2D with a device-pixel-ratio aware backing store (capped at 2×).
- The animation loop stops off-screen and in hidden tabs; resize re-seeds the scene.
prefers-reduced-motion: reducedraws a single static frame.