A horizontal rubber band rendered on canvas, anchored at both ends. Grab any point along the band and drag it to stretch - the band thins as it stretches and glows when under tension. Release to watch it spring back with damping. Features verlet physics with spring constraints, per-segment stretch tracking, metallic anchor rivets, and an optional idle wobble.
rubber-band-pluck-preview
Why it helps: A rubber band is deeply tactile. The stretch-thinning, glow on tension, and spring-back all communicate material properties that users intuitively understand. It's playful and invites repeated interaction.
Also good to know:
// Loading source...
import { RubberBandPluck } from "@/components/live/RubberBandPluck";
<RubberBandPluck
color="#e8b878"
segments={44}
onPluck={(peak) => console.log("peak stretch:", peak)}
/>Horizontal inset from each edge to the anchor.
Number of points along the band.
Spring stiffness (0.3-0.7 recommended).
Velocity damping per frame (0.9-0.99).
Downward pull on the band. 0 for horizontal.
Band thickness at rest in px.
How much the band thins when stretched.
Base band color.
Highlight color along the top edge.
Glow color when stretched.
Show metallic rivet anchors at each end.
Radius around the band where grab activates.
Extra velocity on release (0 = physics only).
Idle sine wobble amplitude in px.
Called with peak stretch when released.
Called when a grab starts.
Additional CSS classes.
import { RubberBandPluck } from "@/components/live/RubberBandPluck";
<RubberBandPluck
color="#e8b878"
segments={44}
onPluck={(peak) => console.log("peak stretch:", peak)}
/>