Skip to content
animorio
IT
All components

Mark as done button

Buttons, Hover, TextGSAP, CSS onlyEasyCompressed weight: Demo 4.7 KBGSAP 28 KBFreeDownload the zip

One button, one sign, in the simple style of product interface pieces: the white «Mark as done» pill with an empty ring. On tap the ring fills from its centre in the accent colour and a check draws inside it, while «Mark as» folds away letter by letter, the gap closes and the d becomes a capital: «Done» is what is left. On a second tap the check slides off and the words open back up one letter at a time.

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>
<!--
  "Mark as done 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 Mark as done button with the words folding away</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" data-stage>
    <!-- one button, one sign: the ring fills with a check and «Mark as» folds away, leaving «Done» -->
    <button class="done" type="button" data-done aria-pressed="false" aria-label="Mark as done">
      <span class="done__body" data-body>
        <svg class="done__icon" viewBox="0 0 24 24" aria-hidden="true">
          <circle class="done__ripple" data-ripple cx="12" cy="12" r="9"/>
          <circle class="done__ring" data-ring cx="12" cy="12" r="8.4"/>
          <path class="done__ghost" data-ghost d="M8.1 12.3l2.7 2.7 5.2-5.6"/>
          <circle class="done__disc" data-disc cx="12" cy="12" r="9.2"/>
          <path class="done__check" data-check d="M8.1 12.3l2.7 2.7 5.2-5.6"/>
        </svg>
        <span class="done__label" aria-hidden="true">
          <span class="done__lead" data-lead><span class="done__lead-in" data-lead-in></span></span><span class="done__d"><span data-d="low">d</span><span data-d="up">D</span></span><span data-tail>one</span>
        </span>
      </span>
    </button>
  </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.

16 values to change

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 “Mark as done 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, alone in the middle, there is a white pill with a thin grey line around it, an empty ring and the words «Mark as done». On tap the pill gives a little and comes back on a spring; the ring steps aside and in its place a disc in the accent colour grows from the centre, ends up a hair too big and settles, and a white check draws inside it, a pixel too far and back. A thin ring breathes out once and disappears. Meanwhile «Mark as» folds away from its end: the letters squeeze and vanish one after the other, the gap closes and the last word slides into place with a pixel of bounce; the small d rises away and a capital D arrives, narrow, opening up on the width axis. «Done» is what is left, a little heavier, and the pill has shortened by itself. On a second tap the check slides off its far end, the disc empties, the ring comes back, the words open up again one letter at a time from the start and the small d returns. Hovering the empty ring draws a faint grey check. Until someone touches it, the pill plays the gesture by itself.

How it works

The words folding away

«Mark as» and the space after it are separate letters inside a box with overflow hidden. The letters squeeze (scaleX 0.4), shift a little and vanish with a stagger from the end, while the box width goes to zero with power3.inOut: the pill itself, a flex box, follows the label with no measuring.

Measured at rest

The width to open back up is measured on the inner line of letters, which keeps its natural size even inside a zero-width box (white-space pre), divided by the pill’s scale: the letters’ transforms do not change it.

The d that becomes a D

The small d and the capital D share one grid cell: the first leaves upwards, the second comes in from below with the wdth axis at 75 and weight 420 and lands at 100 and 600 with back.out; the rest of the word takes the same weight, so «Done» reads more decided.

The ring filling up

The disc grows from 0.2 to 1 around the centre (svgOrigin 12 12) with back.out, so it goes a hair past; the check draws with strokeDashoffset to minus 0.7 and back to zero. To remove it, it goes to minus its length and slides off the far end. A thin circle in the accent colour widens to 1.75 and fades once.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#14a05aThe colour the ring fills with.
LEADscript.jsMark asThe words that fold away.
WORDscript.jsdoneThe word that stays (its first letter becomes a capital).
SPRINGscript.js1How springy the press, the ring and the letters are: 0.4 calm, 2 very bouncy.
SPEEDscript.js1The speed of everything: 2 twice as fast, 0.5 half.
HOLDscript.js2.2How many seconds each state stays when the button plays by itself.
AUTOscript.jstrueThe button plays the gesture by itself until someone touches it.

Try them in the Playground

When to use it

For closing a task in a to-do list, an assignment in a project management app, a step of a guide or a support ticket: the label getting shorter says by itself that it is done.

On phones

On the phone the pill, the ring and the label take their size from the screen (clamp on the shorter side); there is no hover, everything else is the same.

With reduced motion

The disc, the check, the letters and the D swap with a fade, with no springs or movement; the pill takes its new width at once.

Pitfalls

  • Measuring the closing box instead of the line of letters inside it gives zero once it is closed: the measure is taken on the inner line, which with white-space pre stays as wide as its letters.
  • The letters have to be transformed one by one (inline-block): scaling the whole box would squeeze the part that stays too.
  • The space between the two parts lives inside the folding letters: left outside, «Done» would stay a space away from the ring.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 4.7 KB; the libraries: GSAP 28 KB.

Testing

Tested on 31 October 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