Skip to content
animorio
IT
All components

Thumbs up and down button

Buttons, HoverGSAP, CSS onlyEasyCompressed weight: Demo 4.3 KBGSAP 28 KBFreeDownload the zip

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.

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>
<!--
  "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>

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.

11 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 “Thumbs up and down button” 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 white, a light grey pill: on the left the question “Was this helpful?”, on the right two white circles with the thumbs drawn in line, one up and one down. On opening the two circles pop out one after the other. Tap the thumbs up and its circle tightens, bounces and turns blue, the thumb leans back, snaps forward jumping four pixels and comes back upright on a spring, filling slightly, while five blue strokes fan out above it; the other circle dims and the label rolls to “Glad that helped”. Tap the thumbs down and that one turns red: it dips, shakes no once and settles, and the label says “Thanks, we’ll fix it”. Tap the chosen thumb again and the vote is taken back, the question returning.

How it works

Three states

No 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.

The thumbs up

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.

The thumbs down

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.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#2a6df4The colour of the thumbs up when it is chosen.
TILTscript.js18How many degrees the chosen thumb leans before settling.
SPRINGscript.js1How much the thumbs bounce.

Try them in the Playground

When to use it

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.

On phones

The pill is 64 pixels tall and about 300 wide: it fits a 320 screen. The two circles are 48 pixels, 8 apart.

With reduced motion

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.

Pitfalls

  • Up and down are not told apart by colour alone: the two buttons carry a label in words (“Yes, helpful”, “No, not helpful”), aria-pressed and the changing text.
  • The thumbs down is turned in CSS on the svg, and GSAP animates the span holding it: animating the svg itself, GSAP’s rotation would wipe out the CSS one.
  • On a real site the vote goes to the server: if the call fails, the thumb goes back as it was and the user is told.

Libraries

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.

Testing

Tested on 26 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 components