Skip to content
animorio
IT
All components

Withdraw form

Forms, HoverGSAP, CSS onlyMediumCompressed weight: Demo 6.3 KBGSAP 28 KBFreeDownload the zip

The form for withdrawing from an app’s balance: the large amount, a thin bar showing what share of the balance leaves and four pills, 25%, 50%, 75% and Max. Tap a pill and the amount counts to that share, the bar lengthens, the fee comes off “You receive” and the button says how much is withdrawn. Confirm and a light runs through it, the tick appears and the available balance counts down.

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>
<!--
  "Withdraw form" 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>Withdraw form</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 withdraw form of a money app: the percentage pills roll the amount, the balance bar shows the
         share that leaves, the fee and what arrives are worked out again, and the button says how much -->
    <form class="wd" data-wd aria-label="Withdraw" novalidate>
      <header class="wd__head">
        <h2>Withdraw</h2>
        <p>Available <b data-avail></b></p>
      </header>
      <label class="wd__amount" data-amountbox>
        <span class="wd__cur" aria-hidden="true">$</span>
        <input data-amount type="text" inputmode="decimal" autocomplete="off" spellcheck="false" maxlength="9" aria-label="Amount in dollars">
      </label>
      <div class="wd__bar" aria-hidden="true"><span class="wd__out" data-out></span></div>
      <div class="wd__pills" data-pills role="group" aria-label="Share of the balance">
        <span class="wd__marker" data-marker aria-hidden="true"></span>
      </div>
      <dl class="wd__lines">
        <div><dt>To</dt><dd>Everyday account, 4821</dd></div>
        <div><dt>Fee</dt><dd data-fee></dd></div>
        <div><dt>You receive</dt><dd class="wd__get"><span data-get></span></dd></div>
      </dl>
      <button class="wd__go" type="submit" data-go>
        <span class="wd__gofill" data-gofill aria-hidden="true"></span>
        <span class="wd__golabel"><svg viewBox="0 0 16 16" aria-hidden="true"><path data-gotick pathLength="1" d="M3.500 8.500l3 3 6-6.500"></path></svg><span data-golabel></span></span>
      </button>
      <span class="wd__say" data-say aria-live="polite"></span>
    </form>

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

19 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 “Withdraw form” 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 card: “Withdraw” and on the right “Available $2,480.00”, counting up from zero on opening. Below, a grey field with the dollar sign, an empty thin bar, four pills in a row (25%, 50%, 75%, Max), three lines (To, Fee $1.50, You receive) and a dimmed button, “Enter an amount”. Tap 50% and a white marker appears under the pill, the amount in the field counts to 1240.00, the blue bar lengthens to halfway, “You receive” becomes $1,238.50 and the button lights up as “Withdraw $1,240.00”. Move to Max and the marker slides on a spring with everything following. Press the button and it gives, says “Sending” while a blue light runs through it, then “Sent, arrives tomorrow” with a tick drawing itself; at the top the available balance counts down. After a moment the form empties. Type by hand an amount above the balance and the edge and bar turn red and the button says “Over your balance”.

How it works

The pill and the amount

The pill works out its share of the balance and a tween takes a number there, rewritten in the field at each step with two decimals.

Everything follows the amount

A single function reads the field and decides the bar (scaleX equal to amount over balance), what arrives, the red when the balance is exceeded and the button’s words.

The pills’ marker

A white element takes the x and width of the chosen pill on an elastic; the first time it appears by growing, and it goes away if you type by hand.

The confirmation

A band with scaleX from 0 to 1 crosses the button; at the end the available balance, which has a number of its own, counts to its new value.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#3b6cffThe colour of the balance bar, the active field and the light on the button.
BALANCEscript.js2480The available balance, in dollars.
FEEscript.js1.5The flat fee on each withdrawal.
SPRINGscript.js1How much the percentage marker bounces as it moves: 0.3 = a little, 2 = a lot.
LOOPscript.jstrueLeft alone, the demo’s pointer tries the percentages and confirms a withdrawal.

Try them in the Playground

When to use it

In the wallet of a payments app, a sellers’ marketplace, a freelancers’ app or an exchange: wherever part of a balance is taken out.

On phones

The same card, 308 pixels wide at most: the field opens the number keyboard (inputmode decimal), the pills are 30 pixels tall and a quarter of the row wide, the button is 46 tall.

With reduced motion

The amount, the bar and the numbers change at once without counting, the marker jumps onto the pill and the button changes its words without the light. The demo does not move by itself.

Pitfalls

  • Balance, account and fee are made up and nothing is really sent: in a real app the balance and limits come from the server, which runs every check again on confirmation.
  • A click made by script on a submit button still produces a “real” submit event (isTrusted): here the form only blocks the reload and the button’s click does the work.
  • Money is not computed in floating point in a real app: whole cents are needed. Here “Max” rounds down to the cent.
  • Red is not the only signal: the button says “Over your balance” and has aria-disabled.
  • The available balance has a tween object of its own: so the amount’s animations never touch it.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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