
The elastic button
Buttons, Hover, Text
The Refresh button in the header of a made-up analytics app's dashboard, Corvel, light on white: pressed it gives by a pixel, the circular arrow takes a kick and then spins at a steady speed while the pill widens into Syncing 3 sources; beside it the dashboard's three values dim and light up again one by one with a soft flash, the digits rolling and the sparkline growing. Once loading is done the arrow brakes, overshoots a few degrees and settles, then turns into a clock with its hands, and the pill says Updated just now, then Updated 1m ago with the digit rolling.
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>
<!--
"Refresh data button" 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>The Refresh button with the arrow that stops on the clock</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<main class="stage">
<!-- the Refresh button in the header of a made-up analytics dashboard, Corvel: pressed, the arrow spins with a kick,
runs steady while three sources sync, brakes, settles and turns into a clock; the pill says Syncing 3 sources,
then Updated just now, then Updated 1m ago with the digit rolling. Three values beside it flash as fresh data lands -->
<div class="wrap" data-wrap>
<div class="tiles" role="group" aria-label="Corvel overview">
<div class="tile" data-tile>
<span class="tile__flash" data-flash aria-hidden="true"></span>
<span class="tile__label">Revenue</span>
<span class="tile__value" data-value></span>
<span class="tile__foot">
<span class="tile__delta" data-delta></span>
<svg class="spark" viewBox="0 0 40 16" aria-hidden="true"><path class="spark__fill" data-fill></path><path class="spark__line" data-line></path></svg>
</span>
</div>
<div class="tile" data-tile>
<span class="tile__flash" data-flash aria-hidden="true"></span>
<span class="tile__label">Sessions</span>
<span class="tile__value" data-value></span>
<span class="tile__foot">
<span class="tile__delta" data-delta></span>
<svg class="spark" viewBox="0 0 40 16" aria-hidden="true"><path class="spark__fill" data-fill></path><path class="spark__line" data-line></path></svg>
</span>
</div>
<div class="tile" data-tile>
<span class="tile__flash" data-flash aria-hidden="true"></span>
<span class="tile__label">Conversion</span>
<span class="tile__value" data-value></span>
<span class="tile__foot">
<span class="tile__delta" data-delta></span>
<svg class="spark" viewBox="0 0 40 16" aria-hidden="true"><path class="spark__fill" data-fill></path><path class="spark__line" data-line></path></svg>
</span>
</div>
</div>
<div class="slot">
<button class="refresh" type="button" data-refresh data-autoclic aria-label="Refresh the Corvel dashboard">
<span class="refresh__halo" data-halo aria-hidden="true"></span>
<span class="refresh__sheen" aria-hidden="true"></span>
<span class="refresh__in">
<svg class="ic" viewBox="0 0 24 24" aria-hidden="true">
<g data-spin>
<circle class="ic__arc" data-arc cx="12" cy="12" r="7.5"></circle>
<path class="ic__head" data-head d="M11.6 6.1 14.6 5 13 2.2"></path>
</g>
<line class="ic__hand" data-hour x1="12" y1="12" x2="12" y2="8.6"></line>
<line class="ic__hand" data-minute x1="12" y1="12" x2="12" y2="6.8"></line>
</svg>
<span class="lab" data-lab></span>
</span>
</button>
</div>
<span class="measure" data-measure aria-hidden="true"></span>
<p class="sr" data-live aria-live="polite"></p>
</div>
<svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.9Z"></path></svg>
</main>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
<script src="script.js"></script>
</body>
</html>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.
18 values to change
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 “Refresh data button” from Animorio and fit it into my siteThe arrow’s rotation is not a tween: it is an angle a GSAP ticker moves forward by speed times time. On click a tween takes the speed to KICK in a flash and then back to SPEED, so the arrow gets its kick and then spins steady while the sources load.
To stop it the ticker lets go and the angle is taken, with power2.out, to the current one plus speed times BRAKE over two: power2.out starts at twice its average slope, so the arrow leaves at exactly the speed it had. Seven degrees too far, then an elastic.out brings it back: the settle.
The arc is a circle with the full circumference as strokeDasharray and a strokeDashoffset that shows 290 degrees of it; the head is a separate path. The head folds away with scale around its tip, the offset goes to zero and the ring closes, the hands grow from svgOrigin 12 12, the long one turning on a spring. With the ring closed the angle goes back to zero unseen.
Each digit is a 0 to 9 column inside a one line window, moved by yPercent, ten per digit; symbols stay still. When the data lands the columns go to the new digit with back.out, from the last to the first, and the sparkline interpolates its seven points towards the new ones, redrawing the path.
The labels sit on top of each other inside a window; the old one leaves upwards, the new one comes in from below with back.out and the pill’s width is measured on the real sentence in a hidden span with the same typeface, again once the typeface arrives.
| Name | File | Default | What it changes |
|---|---|---|---|
LABEL | script.js | Refresh | The label of the button at rest. |
SOURCES | script.js | 3 | How many sources sync, written in the pill. |
ACCENT | script.js | #4b5cf0 | The colour of the fresh data light, the clock and the sparklines. |
KICK | script.js | 1500 | The arrow’s kick on click, in degrees per second. |
SPEED | script.js | 540 | The arrow’s steady speed while loading, in degrees per second. |
SYNC | script.js | 2.4 | How many seconds loading lasts. |
BRAKE | script.js | 0.9 | How many seconds the arrow takes to stop. |
AGO | script.js | 2.6 | After how many seconds Updated just now becomes Updated 1m ago. |
In the header of an analytics dashboard, an admin panel, a CRM or a back office, next to the numbers the button refreshes: wherever people need to know the data has just landed and how old it is.
Below 640 pixels the three tiles sit in a row on top and the button below, in the middle, widening both ways; the values get slightly smaller and below 360 pixels the sparklines go. A finger presses like the mouse; without hover the arrow does not wind back.
No spinning, springs, travelling flashes or rolling digits: the arrow stays still, the labels change with a fade, the new values appear in place with a flash that fades in and out, and the clock closes in a moment.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 8.4 KB; the libraries: GSAP 28 KB.
Tested on 13 November 2026
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.
Support Animorio
Animorio stays free thanks to the people who support it. If you like, buy us a coffee: it helps us make the next animations.
You asked for
We made it for you: it’s in the library, with the preview, the Playground and the code to copy.
An animation you can’t find, or a site to take apart in the journal: tell us which. We pick the next ones from here.
With your account’s email and password.
or with your email
You’re signed in as .
With your account, you can download the zip of every animation and every pack, for free.