Skip to content
animorio
IT
All components

Approve expense button

Buttons, HoverGSAP, CSS onlyMediumCompressed weight: Demo 7.8 KBGSAP 28 KBFreeDownload the zip

The button of a business expenses app, on black: a graphite pill with a paper receipt in a small well, «Approve expense», the café and the reason under it and the amount on the right. Pressed, the receipt lifts and leans, a mint line reads it twice and every printed line it crosses turns mint, the amount is matched and boxed, and three thin segments fill one per check (Reading receipt, Checking policy, Within budget) while the ring runs around the well. Then the receipt drops into the pill, the mint disc with a check springs into its place, the pill lights up mint and says «Approved» with the payout day; coming near it offers «Undo approval».

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>
<!--
  "Approve expense 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 Approve expense button with the receipt passing the checks</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 gesture: approving an expense in a finance app. The pill holds the receipt on a small paper slip. Pressed,
         the slip lifts, a mint scan line reads it line by line, the amount gets matched, three checks fill a hairline
         (receipt, policy, budget) and the slip drops into the pill as a mint disc with a check: «Approved» -->
    <button class="btn" type="button" data-btn aria-label="Approve expense, Corso Coffee, team lunch, 86.40 dollars">
      <span class="btn__body" data-body>
        <span class="btn__wash" data-wash aria-hidden="true"></span>
        <span class="btn__edge" aria-hidden="true"></span>
        <span class="btn__sheen" data-sheen aria-hidden="true"></span>

        <span class="well" aria-hidden="true">
          <span class="well__hole"></span>
          <span class="slip" data-slip>
            <span class="slip__paper">
              <span class="slip__head"></span>
              <span class="slip__row" data-row></span>
              <span class="slip__row slip__row--s" data-row></span>
              <span class="slip__row" data-row></span>
              <span class="slip__total" data-row></span>
              <span class="slip__scan" data-scan></span>
            </span>
          </span>
          <span class="seal" data-seal>
            <svg viewBox="0 0 40 40"><path class="seal__check" data-check d="M13.6 20.4l4.3 4.3 8.6-9.2"></path></svg>
          </span>
          <svg class="ring" viewBox="0 0 40 40">
            <circle class="ring__fill" data-ring cx="20" cy="20" r="19"></circle>
          </svg>
        </span>

        <span class="txt txt--rest" data-rest>
          <span class="txt__main">Approve expense</span>
          <span class="txt__sub" data-merchant>Corso Coffee · Team lunch</span>
        </span>

        <span class="txt txt--run" data-run>
          <span class="roll" data-roll>
            <span class="roll__item" data-step>Reading receipt</span>
            <span class="roll__item" data-step>Checking policy</span>
            <span class="roll__item" data-step>Within budget</span>
          </span>
          <span class="segs" data-segs>
            <span class="seg"><span class="seg__fill" data-seg></span></span>
            <span class="seg"><span class="seg__fill" data-seg></span></span>
            <span class="seg"><span class="seg__fill" data-seg></span></span>
          </span>
        </span>

        <span class="txt txt--done" data-done>
          <span class="txt__main">Approved</span>
          <span class="txt__sub swap">
            <span class="swap__a" data-payout>Paid out Nov 28</span>
            <span class="swap__b">
              <svg class="undo" viewBox="0 0 16 16" aria-hidden="true"><path d="M5.6 4.2 3 6.8l2.6 2.6M3.4 6.8h5.8a3.4 3.4 0 0 1 0 6.8H7"></path></svg>
              Undo approval
            </span>
          </span>
        </span>

        <span class="amount" data-amount>
          <span class="amount__box" data-box aria-hidden="true"></span>
          <span class="amount__txt" data-amount-txt>$86.40</span>
        </span>
      </span>
    </button>
    <span class="sr" aria-live="polite" data-live></span>

    <svg class="pointer" data-pointer viewBox="0 0 24 24" aria-hidden="true">
      <path d="M5 3.2 18.6 13l-6.1.9 3.6 6.6-2.6 1.4-3.6-6.6L5.3 19.6z"></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.

26 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 “Approve expense 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 black sits a 60-pixel graphite pill with a one-pixel edge that catches light where the pointer passes. On the left, in a recessed well, a receipt of warm paper with a torn zigzag edge, printed lines and a darker total; next to it «Approve expense» and under it «Corso Coffee · Team lunch», on the right «$86.40». Coming near, the receipt peeks out of the well. Pressed, the pill squashes and comes back, the label slides away, the receipt lifts a few pixels and leans; a glowing mint line runs down it and back up, and every line it crosses turns mint. The amount on the right closes in a mint box that arrives with a small bounce: it matches the total that was read. Meanwhile three labels roll by, Reading receipt, Checking policy and Within budget, and under them three thin segments fill, one per check, each with a flash and a small nod of the pill when it ends, while the mint ring runs around the well. At the end the receipt drops into the pill, the mint disc with a drawn check springs into its place, the pill lights up mint from the left with a halo underneath, a reflection crosses it and the label says «Approved» and «Paid out Nov 28». Coming near again «Paid out Nov 28» rolls to «Undo approval»: a tap puts the receipt back in the well. A tap during the checks cancels them. The drawn pointer does it all by itself and stops at the first touch.

How it works

The paper receipt in CSS

The receipt is a 22 by 30 pixel box with a warm gradient and a polygon clip-path that draws the torn teeth at the bottom; the printed lines are one-and-a-half-pixel spans, the total thicker and darker. The resting lean sits on the child (rotate in CSS) while GSAP moves the parent, so the two transforms never cancel each other.

Reading line by line

The mint line is a one-and-a-half-pixel span with two box-shadows for the glow, moved on y by GSAP down and back up. Each line turns mint with a backgroundColor tween placed in the timeline at the moment the scan reaches its height, worked out from the line position divided by the travel of the scan.

Three checks, three segments

The check time is split into three equal steps: for each one the label comes in from below with yPercent and back.out inside an 18-pixel box with overflow hidden, the segment fills with scaleX from the left, and at the end a brightness keyframe and a 0.993 scale on the pill give the small snap of a check that passed.

The disc taking the receipt’s place

The receipt drops 14 pixels, shrinks and fades with power3.in; the mint disc arrives with elastic.out and MOLLA and the check draws with strokeDashoffset on the length read from getTotalLength. The green light under the pill is a CSS variable (--alone) inside the box-shadow of a ::before, animated by GSAP: the shadow sits outside the pill’s overflow hidden and is never cut.

Cancel and undo

The state lives in one variable: at rest a click approves, during the checks it cancels (the timeline stops and everything goes back), when approved it undoes the approval. The Paid out and Undo approval swap is CSS only, on hover inside @media (hover: hover), on keyboard focus and on the is-near class the drawn pointer uses.

Values to change

NameFileDefaultWhat it changes
IMPORTOscript.js$86.40The expense amount, on the right of the pill.
NEGOZIOscript.jsCorso Coffee · Team lunchWhere and why the money was spent, under the label.
PAGAMENTOscript.jsPaid out Nov 28When the reimbursement arrives, in the approved pill.
DURATAscript.js2.4How long the three checks take together, in seconds.
SOLLEVAscript.js5How many pixels the receipt lifts while it is read.
MOLLAscript.js0.42How soft the spring of the arriving disc is (lower bounces more).
ATTESAscript.js2.6How long it stays approved before the drawn pointer undoes it, in seconds.

Try them in the Playground

When to use it

In expense and reimbursement apps, in a manager’s approval panel, in accounting software, in corporate cards and business banking apps: anywhere an action approves a payment after automatic checks.

On phones

The same 60-pixel pill, 88 per cent of the screen wide up to 340 pixels; the reason for the expense is cut with an ellipsis if it does not fit. A tap approves, a tap during the checks cancels and a tap on the approved pill undoes it; without hover, Undo approval shows on focus.

With reduced motion

No jumps, springs or reflections: the labels fade one after another, the segments light up without sliding, the receipt lines fade to mint, the ring fills and at the end the receipt fades into the mint disc with the check already drawn. The drawn pointer is hidden.

Pitfalls

  • The button is a button, which centres text: the two-line labels in a flex column ended up one centred and one on the left. The label box needs text-align: left.
  • The receipt peeking on hover and the timeline of the checks move the same element: without killTweensOf on click the hover spring kept running under the scan and the receipt shook.
  • When cancelling, the segments empty from the right with transformOrigin 100%: without putting the origin back on the left at rest, on the next run they filled backwards.
  • Two labels rolling at the same moment showed half on top of each other: the new one comes in only when the old one has almost left.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 15 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