Metaballs
newA lava lamp of implicit-surface blobs with fake-3D shading from the field gradient. One blob is glued to your pointer and merges with the others on contact.
webglpointersdf6 files · 643 locdeps: clsx, tailwind-merge
Installation
With the shadcn CLI, pointing at this platform’s registry:
npx shadcn@latest add https://opusui.131199999.xyz/r/metaballs.jsonOr offline, straight from your opus55 checkout (copies every file it needs):
node ../tailwind_component/opus55/scripts/add.mjs metaballsUsage
import { Metaballs } from "@/components/opus/backgrounds/metaballs";
<Metaballs colorA="#ff4d8d" colorB="#ffb86b" className="absolute inset-0" />API
| Prop | Type | Default | Description |
|---|---|---|---|
| colorA / colorB | string | — | Vertical blob gradient. |
| background | string | "#0c0612" | Backdrop colour. |
| size | number | 1 | Blob radius multiplier. |
| count | number | 7 | Drifting blobs (2–10). |
| glow | number | 0.8 | Halo around the blobs. |
| speed | number | 1 | Time multiplier. 0 freezes the animation; the pointer stays live. |
| interactive | boolean | true | React to the pointer (tracked on window, so overlaid content never blocks it). |
| className | string | — | Classes for the wrapper. Use `absolute inset-0` to fill a relative parent. |
| children | ReactNode | — | Optional content rendered above the canvas. |
Notes
- Renders with WebGL2 into a single full-screen triangle — no three.js, no textures, no dependencies.
- Pauses automatically when scrolled off-screen or when the tab is hidden; resumes on return.
prefers-reduced-motion: reducerenders one still frame and ignores the pointer.- A CSS gradient fallback paints instantly and stays if WebGL2 is unavailable.