
The elastic button
Buttons, Hover, Text
The usage card of a subscription, for an app’s settings: three bars (requests, storage, seats) fill on a spring while their numbers count up. Over a row, a paler striped bar shows where the month is heading and the number becomes the forecast. When the first bar passes the mark of the limit it turns amber, the mark takes the knock and a line opens below with the warning and the ‘Upgrade’ button.
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>
<!--
"Plan usage card" 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>Plan usage card with bars that fill and a warning near the limit</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 usage card of a plan: three bars fill on a spring while their numbers count up; over a row a paler bar
shows where the month is heading; when the first bar passes the mark of the limit it turns amber, the mark
takes the knock and a line opens below with the way out -->
<section class="card" data-card aria-label="Plan usage">
<header class="head">
<h2>Usage</h2>
<span class="head__plan">Pro plan</span>
<span class="head__reset">Resets in 12 days</span>
</header>
<div class="meter" data-meter data-used="84200" data-max="100000" data-pace="118" data-unit="">
<div class="meter__top">
<span class="meter__name">API requests</span>
<span class="meter__val"><span class="meter__now"><b data-n>0</b> of 100,000</span><span class="meter__pace" data-pace-text>On pace for 118%</span></span>
</div>
<div class="meter__track"><i class="meter__proj" data-proj></i><i class="meter__fill" data-fill></i><i class="meter__mark" data-mark></i></div>
</div>
<div class="meter" data-meter data-used="31.4" data-max="50" data-pace="81" data-unit=" GB">
<div class="meter__top">
<span class="meter__name">Storage</span>
<span class="meter__val"><span class="meter__now"><b data-n>0</b> of 50 GB</span><span class="meter__pace" data-pace-text>On pace for 81%</span></span>
</div>
<div class="meter__track"><i class="meter__proj" data-proj></i><i class="meter__fill" data-fill></i><i class="meter__mark" data-mark></i></div>
</div>
<div class="meter" data-meter data-used="7" data-max="10" data-pace="70" data-unit="">
<div class="meter__top">
<span class="meter__name">Seats</span>
<span class="meter__val"><span class="meter__now"><b data-n>0</b> of 10</span><span class="meter__pace" data-pace-text>3 seats free</span></span>
</div>
<div class="meter__track"><i class="meter__proj" data-proj></i><i class="meter__fill" data-fill></i><i class="meter__mark" data-mark></i></div>
</div>
<div class="warn" data-warn>
<div class="warn__in">
<svg class="warn__icon" viewBox="0 0 18 18" aria-hidden="true"><path d="M9 2.6 16 15H2Z"></path><path d="M9 7.4v3.4M9 12.9v.2"></path></svg>
<span class="warn__text">Near the request limit</span>
<button class="warn__go" type="button" data-go>Upgrade</button>
</div>
</div>
</section>
<p class="sr" data-live aria-live="polite"></p>
<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.
29 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 “Plan usage card” from Animorio and fit it into my siteEach row is an object with the used value, the maximum and the forecast, read from the HTML’s data attributes. GSAP animates a single number, the value: one function turns it into the bar’s width and the text, with thousands separators or one decimal.
The bars fill with back.out, 0.14 seconds apart: they overshoot and come back. The limit only counts once they have settled, otherwise the first one’s bounce would trip the warning.
Under the full bar sits a striped one (repeating-linear-gradient): on hover it starts from the current width and reaches the forecast. The number and the ‘On pace for’ text share one grid cell and swap with opacity and six pixels of movement.
When the value passes LIMIT the row takes the is-near class, which changes one CSS variable: bar, number and mark turn amber with their transitions. The mark stretches and comes back with elastic.out.
The warning is a container of zero height: GSAP takes the height to auto with back.out, so the card grows with a small bounce, and the button arrives later, from 0.7 to 1.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #4a5cff | The colour of the bars. |
WARN | script.js | #f08c00 | The colour near the limit. |
LIMIT | script.js | 90 | The percentage where the limit mark sits. |
PEAK | script.js | 93 | How high the first bar climbs, in percent: below the mark, the warning never opens. |
FILL | script.js | 1.1 | How many seconds a bar takes to fill. |
BOUNCE | script.js | 1.6 | How far the bar overshoots and comes back: 0 = no bounce. |
LOOP | script.js | true | Left alone, the card tells itself again. |
For the plan or billing page in an app’s settings, or a corner of the dashboard: how much has been used, where the month will end up and what to do when the limit is near.
The same component: the card takes the screen width minus the margins and the gaps between rows also follow the window’s height. Tapping a row shows its forecast; tapping it again brings the number back.
No fills and no springs: the card fades in already at its highest point, with the warning open. The forecast fades in and out.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 5.5 KB; the libraries: GSAP 28 KB.
Tested on 14 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.