Crucible

Ballast

A physics ballpit background in sea-glass celadon: frosted spheres pour in from a corner and drift under low gravity like objects underwater, jostling softly while the pointer stirs gentle currents. Instanced rigid bodies, DPR-clamped, offscreen-paused, reduced-motion-safe.

r3fpro

Installation

CLI

npx shadcn@latest add @crucible/ballast

Manual — install dependencies, then copy the source

npm install three @react-three/fiber @react-three/rapier @react-three/postprocessing

Props

PropTypeDefaultDescription
countnumber30How many sea-glass spheres drift in the tank (plus one oversized "keystone" sphere that anchors the composition). Rendered as a single instanced draw call.
colorsstring[]a tight celadon-to-glaucous sea-glass ramp so the pit reads as one material in many sizes, not a rainbow ballpitPalette of hex colors, assigned per sphere.
gravitynumber1Gravity multiplier. 1 = the default dreamy underwater sink; push toward 3 for a snappier pit, toward 0.3 for near-weightless drift.
driftnumber1Strength of the ambient current that keeps the spheres slowly circulating (0 lets them settle completely).
intensitynumber1Master brightness for lights and highlight bloom.
interactivebooleantrueEnable pointer stirring — the cursor is an invisible paddle with gentle force. Automatically disabled on touch / coarse-pointer devices.
pausedbooleanfalseFreeze the simulation with the spheres in a settled, aesthetic pile. Also forced on when the user prefers reduced motion.
classNamestringExtra classes for the wrapper. Positioned absolute inset-0 -z-10.

Honors prefers-reduced-motion with a designed static fallback, pauses offscreen and on hidden tabs, and passes className through.