
The elastic button
Buttons, Hover, Text
The two thumbs of “Was this helpful?”, under an answer or an article. The thumbs up, tapped, takes a run-up, jumps and settles while its circle turns blue and five short strokes fly off around it; the thumbs down dips and shakes no once, in red. The thumb not chosen steps back, the question rolls into a thank you, and tapping the same thumb again takes the vote back.
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>
<!--
"Thumbs up and down 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>Thumbs up and down</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 two thumbs under an answer or an article: the chosen one tilts and fills,
the other steps back, and the question turns into a thank you -->
<div class="th" data-th data-vote="none" role="group" aria-label="Was this helpful?">
<span class="th__label"><span data-outlabel>Was this helpful?</span></span>
<button class="th__btn th__btn--up" type="button" data-vote-up aria-pressed="false" aria-label="Yes, helpful">
<span class="th__rays" aria-hidden="true"><i></i><i></i><i></i><i></i><i></i></span>
<span class="th__ico" data-ico aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M7.200 10.400v9.100H4.700a1.200 1.200 0 0 1-1.200-1.200v-6.700a1.200 1.200 0 0 1 1.200-1.200ZM7.200 10.400l3.500-6.100a1.900 1.900 0 0 1 3.500 1.300l-.7 3.600h4.300a2 2 0 0 1 2 2.400l-1.200 6.300a2 2 0 0 1-2 1.600H7.200"></path></svg></span>
</button>
<button class="th__btn th__btn--down" type="button" data-vote-down aria-pressed="false" aria-label="No, not helpful">
<span class="th__ico" data-ico aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M7.200 10.400v9.100H4.700a1.200 1.200 0 0 1-1.200-1.200v-6.700a1.200 1.200 0 0 1 1.200-1.200ZM7.200 10.400l3.500-6.100a1.900 1.900 0 0 1 3.500 1.300l-.7 3.600h4.300a2 2 0 0 1 2 2.400l-1.200 6.300a2 2 0 0 1-2 1.600H7.200"></path></svg></span>
</button>
</div>
<span class="live" aria-live="polite" data-live></span>
<svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.200 19.200 11l-6.300 1.600-3.300 5.900Z"></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.
11 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 “Thumbs up and down button” from Animorio and fit it into my siteNo vote, up, down: the state is in an attribute of the pill and in the aria-pressed of the two buttons. Tapping the thumb already chosen goes back to no vote.
A small timeline: a run-up backwards in a tenth of a second, a snap forward with a jump, then back to zero on an elastic spring. The five strokes leave from a circle around the thumb and move away fading.
It is the same drawing turned half a turn in CSS; GSAP moves its wrapper: four pixels down, a lean one way and the other, then back. That way CSS and GSAP do not fight over the same element.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #2a6df4 | The colour of the thumbs up when it is chosen. |
TILT | script.js | 18 | How many degrees the chosen thumb leans before settling. |
SPRING | script.js | 1 | How much the thumbs bounce. |
Under an AI assistant’s answer, at the end of a help or docs article, after a search, under a translation or a summary: wherever a yes or a no is enough to know whether it helped.
The pill is 64 pixels tall and about 300 wide: it fits a 320 screen. The two circles are 48 pixels, 8 apart.
The thumbs do not jump or lean, no strokes: on tap the circle’s colour and the label change, and the thumb not chosen dims. The demo’s pointer does not start.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 4.3 KB; the libraries: GSAP 28 KB.
Tested on 26 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.