Skip to content
animorio
IT
Back to the library

Rubber-band list

Physics, ScrollGSAPMediumCompressed weight: Demo 5.6 KBGSAP 28 KBFreeDownload the zip

The inbox of a made-up mail app, Larkpost, that stretches like a rubber band past its end: pulling beyond the first or the last message the resistance grows, the rows spread apart in a stagger, the one nearest the finger the most and the far ones less, each on its own spring, and on release they settle one after the other with a pixel of rebound. In the gap «You’re all caught up» shows at the bottom and «Synced just now» at the top. Hand-written physics. Minimal style, a single accent.

The code

A folder that runs on its own: index.html, style.css, script.js and the libraries from a CDN. The React and Vue tabs hold the same demo as a ready component, which switches its animations off when it leaves the page.

<!doctype html>
<!--
  "Rubber-band list" from Animorio · https://animorio.com
  License: free on your own sites and your clients’ sites, paid work included.
  Not for resale, redistribution, templates or code collections · https://animorio.com/en/license/
-->
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Rubber-band list</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/jetbrains-mono@5.3.0/index.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <!-- The inbox of a made-up mail app, Larkpost. Past the end of the list, at the top and at the bottom, the list
       stretches like a rubber band: the rows spread apart, the one nearest the pull the most, and on release they
       spring back one after the other. Drag it, use the wheel, or watch it on its own. -->
  <main class="stage">
    <section class="app" data-app aria-label="Larkpost inbox">
      <header class="app__head" data-in>
        <p class="app__brand">
          <svg viewBox="0 0 20 20" aria-hidden="true"><path d="M3 6.5 10 11l7-4.5" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><rect x="2.75" y="4.25" width="14.5" height="11.5" rx="2.5" fill="none" stroke="currentColor" stroke-width="1.5"/></svg>
          Larkpost
        </p>
        <div class="app__title">
          <h1>Inbox</h1>
          <span class="app__new">3 new</span>
        </div>
      </header>

      <div class="view" data-view>
        <p class="hint hint--top" data-hint-top>
          <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M13 8a5 5 0 1 1-1.6-3.7" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/><path d="M13 2.5V5h-2.5" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/></svg>
          Synced just now
        </p>
        <p class="hint hint--bottom" data-hint-bottom>
          <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3.5 8.5 6.5 11.5 12.5 5" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>
          You’re all caught up
        </p>

        <ul class="list" data-list>
          <li class="row is-new"><span class="ava">MO</span><span class="txt"><b>Mara Osei</b><span>Draft for Thursday’s review</span></span><time>9:41</time></li>
          <li class="row is-new"><span class="ava">TK</span><span class="txt"><b>Theo Kask</b><span>Re: the flight to Lisbon</span></span><time>9:12</time></li>
          <li class="row is-new"><span class="ava">FB</span><span class="txt"><b>Field Books</b><span>Your order has shipped</span></span><time>8:30</time></li>
          <li class="row"><span class="ava">IR</span><span class="txt"><b>Ines Rowe</b><span>Photos from Saturday</span></span><time>Yesterday</time></li>
          <li class="row"><span class="ava">LP</span><span class="txt"><b>Larkpost</b><span>Three tips for a quieter inbox</span></span><time>Yesterday</time></li>
          <li class="row"><span class="ava">DH</span><span class="txt"><b>Dev Halden</b><span>Invoice 0412, paid</span></span><time>Tue</time></li>
          <li class="row"><span class="ava">NA</span><span class="txt"><b>Nadia Albers</b><span>Lunch next week?</span></span><time>Mon</time></li>
          <li class="row"><span class="ava">GC</span><span class="txt"><b>Greenline Cycles</b><span>Your bike is ready for pickup</span></span><time>Sun</time></li>
          <li class="row"><span class="ava">SV</span><span class="txt"><b>Sami Voss</b><span>Notes from the call</span></span><time>Sat</time></li>
        </ul>
      </div>
    </section>
    <p class="note" data-in>Pull past the end</p>
  </main>

  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
  <script src="script.js"></script>
</body>
</html>

Playground

Change values, colours and text with the controls and watch the animation respond live. Or write in the code yourself. Then download the folder with your changes.

55 values to change

Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI

Or ask your AI assistant for it

With the Animorio connector, Claude Code, ChatGPT, Cursor or VS Code take it from here, guide included, and fit it into your project. Paste this request:

Take “Rubber-band list” from Animorio and fit it into my site
Platform licenseFree on your sites and your clients’ sites. Want it inside a website builder, a template platform or a client dashboard? There’s a license for agencies and platforms.

What it does

On a warm white page, the card of a mail app, Larkpost: at the top the brand, the Inbox title and the orange «3 new» pill, below nine messages with initials in a circle, the name, the subject and the time; the three new ones are bold. Dragging the list, or with the wheel, it scrolls; past the last message the list does not stop dead: it follows the finger with more and more effort, and the rows spread apart, the last one the most and the first ones barely, so a gap opens at the bottom where «You’re all caught up» rises with its check. On release the rows spring back, the near ones first and the far ones a moment later, and settle with a pixel of rebound. At the top the same happens the other way round, with «Synced just now». When nobody touches, the list scrolls down to the end by itself, pulls, lets go, goes back up and pulls at the top.

How it works

The fake scroll

The list sits in a box with hidden overflow and moves with y: the scroll s runs from 0 to the maximum, the list height minus the box height, measured again on resize. Finger, wheel and autopilot all write one raw position.

The rubber band

Past the edge the raw position goes through the band function, (1 − 1 / (x · RESISTANCE / MAX_PULL + 1)) · MAX_PULL: at first it follows almost one to one, then less and less, and never goes beyond MAX_PULL pixels. The result is over, positive at the bottom and negative at the top.

The rows on springs

Each row has its own hand-written spring in the GSAP ticker, using the real time between frames: it chases −over times its weight, ((i + 1) / N) to the power of SPREAD, which is 1 for the row at the pulled edge and less for the far ones. The far ones also get a softer spring (LAG), so they arrive and come back a moment later.

The return

On release, over goes back to zero on a spring, STIFFNESS and DAMPING, never crossing to the other edge; the rows follow it each on its own, and the ones near the edge, just under critical damping, overshoot by a pixel before they stop.

The hints

«You’re all caught up» and «Synced just now» sit under the list, hidden by the opaque rows: they only show in the gap opening at their edge, and their opacity and small rise follow how wide the gap is.

Values to change

NameFileDefaultWhat it changes
STIFFNESSscript.js220How stiff the springs of the rows are.
DAMPINGscript.js23How quickly the rows calm down: low they wobble, high no rebound.
RESISTANCEscript.js0.55How hard the pull gets past the end.
MAX_PULLscript.js150The most the list can stretch, in pixels.
SPREADscript.js1.2How the gaps are shared among the rows: 1 evenly, 3 mostly among the rows far from the edge.
LAGscript.js0.55How much softer the far rows are, so they follow later.
AUTO_PILOTscript.js3After how many still seconds the list pulls by itself (0 never).
--accentstyle.css#e2552dThe single accent colour: the new-count pill and the hint icons.

Try them in the Playground

When to use it

In the lists of an app or a web app: mail, notifications, tasks, chat, orders; wherever the end of a list should feel alive instead of a wall, as on a phone.

On phones

The card is sized on both width and height, the rows in vh too. You pull with a finger, with the same physics; when nobody touches, the list pulls by itself.

With reduced motion

No stretch: the list scrolls and stops at the edge, where the edge hint fades in and away; the card and the rows fade in.

Pitfalls

  • The wheel has no «release»: it counts as released 0.14 seconds after the last notch, with a GSAP delayedCall and not setTimeout, so the bench can drive it.
  • The spring bringing the stretch back to zero must not cross to the opposite edge: if it changes sign it stops at zero, otherwise the list would stretch for a moment on the other side.
  • The box has touch-action: none, otherwise on a phone the finger would scroll the page instead of the list.
  • The time between two frames is capped at a thirtieth of a second: after a tab left in the background the springs would blow up.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, JetBrains Mono (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 5.6 KB; the libraries: GSAP 28 KB.

Testing

Tested on 27 November 2026

  • Desktop: Done
  • Phone: Done
  • Reduced motion: Done
  • Safari on iPhone: To do

License

Use it in your own projects and in your clients’ projects. Do not resell it or redistribute it as is. GSAP stays under its own Standard license. Full license.

All animations