Rubber-banding
Also called elastic overscroll, overscroll bounce, or rubber band effect
An edge effect where content dragged past its limit moves less than your finger, then springs back on release, like a stretched rubber band.
import { motion } from 'motion/react';
const messages = [
{ from: 'Maya Chen', subject: 'Launch checklist' },
{ from: 'Leo Park', subject: 'Pricing page copy' },
{ from: 'Ava Ruiz', subject: 'Q3 roadmap review' }
];
export function MessageList() {
return (
// overscroll-none keeps the browser's own bounce from doubling up.
<div className='h-72 w-80 overflow-hidden overscroll-none rounded-2xl border bg-muted'>
<motion.ul
drag='y'
// The list fits, so any pull goes past an edge.
dragConstraints={{ top: 0, bottom: 0 }}
// Past the edge, the list moves a third of the drag distance.
dragElastic={0.33}
// On release, it springs back with this stiffness and damping.
dragTransition={{ bounceStiffness: 400, bounceDamping: 30 }}
className='cursor-grab touch-none bg-background active:cursor-grabbing'
>
{messages.map((message) => (
<li key={message.subject} className='border-b px-4 py-3'>
<p className='text-sm font-medium'>{message.from}</p>
<p className='text-sm text-muted-foreground'>{message.subject}</p>
</li>
))}
</motion.ul>
</div>
);
}Let the message list stretch when it is pulled past its top or bottom edge: move it a third of the drag distance, then spring it back with stiffness 400 and damping 30 on release. Support touch and mouse, and set overscroll-behavior: none on the list so the browser’s own bounce does not double up.
Paste into Layerwise or any AI coding tool.
What is Rubber-banding?
Rubber-banding tells people they have reached the end with a soft stop. Pull a list past its top and it follows your finger reluctantly, opening a gap; let go and it springs back into place. iOS scroll views do it by default, and it is a big part of why scrolling there feels physical.
Use it at the edges of anything draggable or scrollable: lists, carousels, bottom sheets, and sliders that reach their limit. It also gives pull-to-refresh its stretch.
In Motion, set dragConstraints and dragElastic, where 0 is a hard stop and 1 follows the pointer fully; values from 0.1 to 0.3 feel natural. Apple’s version adds more resistance the further you pull. Browsers on Apple devices already rubber-band scrolling pages, so set overscroll-behavior: none where you build your own.
Often confused with
- Pull to refresh
- Pull-to-refresh is built on rubber-banding: stretching past a threshold reloads the content.
Related terms
All termsMomentum
The glide an element keeps after a throw or flick, slowing down gradually like an object sliding across a smooth table.
Pull to refresh
A gesture where you drag a list down from the top to reveal a spinner and load fresh content, common in mobile feeds and inboxes.
Drag gesture
Moving an element by pressing on it and sliding the pointer or finger, usually within set bounds and with a glide after release.
Spring animation
An animation driven by simulated spring physics in place of a fixed duration and curve, so motion can overshoot, settle, and react naturally.
Build it with Layerwise
Describe your app, watch it run in a live preview, and publish it with a database, storage, and sign-in built in.