
The elastic button
Buttons, Hover, Text
The size guide of a made-up knitwear shop, Northmere: a clean table of sizes XS to XL with chest, waist and hip measurements. The cm / in switch slides its thumb on a spring and rolls every number to the other unit, column by column; the «Your chest» slider lights up the right size with a blue band that slides onto it, dims the others and says «Your size: M», and near the line between two sizes the band stretches over both rows and suggests the larger one. Minimal style.
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>
<!--
"Size guide" 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>Size guide</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/instrument-sans@5.3.0/index.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/fraunces@5.3.0/index.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<main class="stage" data-stage>
<!-- the size guide of a made-up knitwear shop: cm / in rolls every number, and the chest slider lights up the
right row with a band that slides, or stretches over two rows when you are between sizes -->
<section class="guide" aria-labelledby="guide-title" data-guide>
<header class="guide__head">
<div>
<h2 class="guide__title" id="guide-title">Size guide</h2>
<p class="guide__sub">Northmere merino crew · regular fit</p>
</div>
<div class="unit" role="radiogroup" aria-label="Units" data-unit>
<span class="unit__thumb" aria-hidden="true" data-thumb></span>
<button class="unit__opt is-on" type="button" role="radio" aria-checked="true" data-u="cm">cm</button>
<button class="unit__opt" type="button" role="radio" aria-checked="false" data-u="in">in</button>
</div>
</header>
<div class="table" role="table" aria-label="Body measurements by size" data-table>
<div class="row row--head" role="row">
<span role="columnheader">Size</span><span role="columnheader">Chest</span><span role="columnheader">Waist</span><span role="columnheader">Hips</span>
</div>
<div class="rows" data-rows>
<span class="band" aria-hidden="true" data-band><span class="band__edge" data-edge></span></span>
</div>
</div>
<div class="fit">
<div class="fit__top">
<label class="fit__label" for="chest">Your chest</label>
<span class="fit__value" aria-hidden="true"><span class="roll" data-chestval></span><span class="fit__unit" data-chestunit>cm</span></span>
</div>
<div class="slider" data-slider>
<span class="slider__track" aria-hidden="true"><span class="slider__fill" data-fill></span><span class="slider__ticks" data-ticks></span></span>
<input class="slider__input" id="chest" type="range" min="80" max="120" step="0.5" value="92" data-chest>
<span class="slider__knob" aria-hidden="true" data-knob></span>
</div>
<p class="verdict" aria-live="polite" data-verdict></p>
</div>
</section>
</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.
23 values to change
Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI
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 “Size guide” from Animorio and fit it into my siteThe data is in centimetres as [from, to] pairs for chest, waist and hips; inches are worked out on the fly (cm / 2.54, to one decimal), so there aren’t two tables to keep in step. The slider works in centimetres too: only what you read changes.
Each cell holds a single span, inside a one-line window with hidden overflow. To change unit a timeline sends it up by 100% as it fades, swaps the text and brings it up from below with back.out; the delay is (column × 3 + row) × ROLL_STAGGER, so the change sweeps across the table diagonally.
The band is a single element, absolute inside the table body. The row (or two rows) of the size is worked out from the value and y and height go to the first row’s offsetTop and the last row’s bottom with back.out(SPRING): between two sizes the same band stretches over both rows instead of jumping.
The lines sit halfway between the end of one size and the start of the next (87.5, 95.5, 103.5, 111.5 cm), shown as ticks on the track. If the chest is within BETWEEN centimetres of a line the result is the pair of sizes, and the line suggests the larger one.
Under the drawn knob there’s a real, transparent range input: keyboard, screen readers and touch work on their own; the script reads the value and moves the knob, the fill and the ticks.
| Name | File | Default | What it changes |
|---|---|---|---|
SLIDE | script.js | 0.55 | The seconds the band takes to slide to the right row. |
SPRING | script.js | 1.5 | How far the band and the switch go past their place as they land (back.out). |
ROLL | script.js | 0.42 | The seconds a number takes to roll to the other unit. |
ROLL_STAGGER | script.js | 0.025 | The seconds between one number and the next as they roll. |
BETWEEN | script.js | 1 | How close to the line between two sizes counts as «between», in cm. |
DIM | script.js | 0.42 | How faint the other rows go, from 0 to 1. |
START | script.js | 92 | The chest the slider starts on, in cm. |
On a clothing, shoe or accessory product page, in a «Size guide» window beside the size picker, or on the shop’s sizing page.
The card takes almost the full width, the rows get shorter with the screen height and the type goes down to 13 pixels; the slider drags with a finger.
The numbers change unit without rolling, the band goes straight to the right row and the guide doesn’t move by itself.
GSAP 3.15.0, Instrument Sans (font variabile) 5.3.0, Fraunces (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.7 KB; the libraries: GSAP 28 KB.
Tested on 20 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.
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.