crucıble

Plumbline

A physics ID badge on a lanyard: a verlet-simulated strap hangs from above, the charcoal card sways with gravity and an ambient breeze, and you can grab, drag, and fling it — it swings and settles with real momentum. Hand-rolled rope physics, offscreen-paused, reduced-motion-safe; a ghost hand flicks it now and then when untouched.

r3fpro

Installation

CLI

npx shadcn@latest add @crucible/plumbline

Manual — install dependencies, then copy the source

npm install three @react-three/fiber

Props

PropTypeDefaultDescription
namestring"Avery Quinn"Name printed on the badge face.
rolestring"Staff Engineer"Role/subtitle printed under the name.
cardColorstringCard slab color (hex). Matte charcoal by default.
strapColorstringLanyard strap color (hex). The strap is the composition's single accent — deep crimson by default.
gravitynumber1Gravity multiplier. 1 = natural badge weight, lower floats dreamily.
swaynumber1Idle sway intensity (0 disables the ambient breeze).
interactivebooleantrueEnable grab-and-fling dragging (and Left/Right-arrow swings when focused).
pausedbooleanfalseFreeze the badge at its rest pose. Also forced visually static when the user prefers reduced motion (drag stays available but critically damped).
classNamestringExtra classes for the wrapper (fills its container: relative h-full w-full).
idlebooleantrueIdle autoplay: after 1.5s with no pointer over the stage, a ghost hand gives the badge an occasional gentle seeded flick (every ~4–7s) on top of the breeze, so it keeps swinging in thumbnails and heroes. Any real pointer suppresses it instantly. Off under reduced motion / paused.
refReact.Ref<PlumblineHandle>Imperative handle — see {@link PlumblineHandle}.

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