crucıble

Conduit

An animated beam connecting two DOM nodes via refs — a dark groove path carrying a blue-to-white slug of light that travels into the destination and flashes a white rim-glow on receipt. Curved, reversible, resize-aware.

motionfree

Installation

CLI

npx shadcn@latest add @crucible/conduit

Manual — install dependencies, then copy the source

npm install motion

Props

PropTypeDefaultDescription
containerRefReact.RefObject<HTMLElement | null>The positioned ancestor both fromRef and toRef live inside — the SVG overlay fills this.
fromRefReact.RefObject<HTMLElement | null>Source node the beam departs from.
toRefReact.RefObject<HTMLElement | null>Destination node the beam pours into.
curvaturenumber0Bend amount in px. Positive bows the path downward, negative upward.
reversebooleanfalseReverse the flow so the beam travels from toRef back to fromRef.
durationnumber3Seconds for one full slug travel + loop.
delaynumber0Seconds before the first pass starts.
startXOffsetnumberHorizontal/vertical pixel offsets applied to the start point (on fromRef).
startYOffsetnumber
endXOffsetnumberHorizontal/vertical pixel offsets applied to the end point (on toRef).
endYOffsetnumber
pathColorstring"#2a2a30"Static groove (channel) color.
pathOpacitynumber0.5Static groove opacity.
pathWidthnumber2Groove + slug stroke width in px.
slugColors[string, string, string]["#ffffff", "#93c5fd", "#3b82f6"]Slug head/body/tail colors, bright to dim.
glowOnReceivebooleantrueFlash a brief rim-glow on the receiving node each time the slug arrives.
Also accepts all props of Omit<React.ComponentPropsWithoutRef<"svg">, "children">they pass through to the underlying element.

Honors prefers-reduced-motion with a designed static fallback, and passes className through.