Power-User Systems

Elastic

Throw the top card and the speed you released it at carries into the spring — throw it far enough and it cycles to the back of the deck instead of coming home.

Install

bun add motion clsx tailwind-merge

Then copy 2 files into your project:

  • components/registry/elastic/elastic.tsx
  • lib/utils.ts

Props

PropTypeDefaultDescription
stiffnessnumber320How strongly the spring pulls home. Higher is snappier.
dampingnumber22How fast it settles. Lower overshoots and oscillates.
massnumber1How heavy the card feels. More mass is more sluggish.
boundsnumber140How far the card may travel from home.
rubberBandnumber0.45Give past the bounds, hard wall → loose.
flickPowernumber1Multiplier on the release velocity handed to the spring.
cardsnumber3How many cards in the stack.
throwThresholdnumber90Throw distance past which the card cycles to the back instead of springing home. Capped at 90% of bounds so it stays reachable.

What It Demonstrates

Spring
Motion driven by physics (tension, mass, damping) rather than a set duration.
Swipe to dismiss
Dragging an element off-screen to close it, like a drawer or toast.
Stiffness / Tension
How strongly the spring pulls toward its target. Higher feels snappier.
Damping
How quickly a spring settles. Lower damping means more bounce and oscillation.
Mass
How heavy the animated element feels. More mass makes it slower and more sluggish.
Momentum
Motion that carries velocity, especially after a drag or interruption.
Velocity
How fast and in which direction an element is moving. A spring carries it into the next animation when interrupted, so a flicked element keeps its speed.
Interruptible animation
An animation that can be smoothly redirected mid-flight instead of finishing first.
Rubber-banding
Resistance and snap-back when you drag past a boundary (the iOS overscroll feel).
Drag
Moving an element by grabbing it, often with momentum when released.
Bounce
A spring that overshoots and settles, adding playfulness.
Follow-through
Parts of an element keep moving and settle slightly after the main motion stops, adding weight.

Related Components

Appears In