Skip to content
animorio
IT
All components

Monthly budget gauge

Charts, Hover, SVGGSAP, CSS onlyMediumCompressed weight: Demo 9.6 KBGSAP 28 KBFreeDownload the zip

The November budget card of a personal finance app, dark on black: a half ring is the whole month’s budget, the spent part draws itself on a spring in four tones of lime (rent, groceries, transport, fun) and a tick marks today. Point at a slice and it lifts with its shadow while the centre rolls to its figure; a tap opens the payments of that category underneath.

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>
<!--
  "Monthly budget gauge" 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 monthly budget gauge chart that opens into the expenses</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>
    <!-- the monthly budget card of an invented finance app: a half ring of the budget, the spent part split into four
         categories that draw themselves on a spring, the mark of today on the ring, the money left rolling in the middle;
         a slice lifts with its shadow when you point at it and a tap opens the payments of that category -->
    <section class="budget" data-card aria-label="Tally monthly budget">
      <span class="budget__sheen" aria-hidden="true"></span>
      <header class="budget__head">
        <div class="budget__title">
          <svg class="budget__mark" viewBox="0 0 24 24" aria-hidden="true"><path d="M5 17.5a7 7 0 0 1 14 0"></path><path d="M12 17.5 15.6 12"></path></svg>
          <div>
            <p class="budget__name">November budget</p>
            <p class="budget__total">$3,200 planned</p>
          </div>
        </div>
        <p class="budget__day"><span>Day 18</span> of 30</p>
      </header>

      <div class="gauge" data-gauge>
        <svg class="gauge__svg" viewBox="0 0 240 136" aria-hidden="true">
          <defs>
            <filter id="lift" x="-30%" y="-30%" width="160%" height="170%">
              <feDropShadow dx="0" dy="3.5" stdDeviation="3.2" flood-color="#000" flood-opacity="0.75"></feDropShadow>
            </filter>
          </defs>
          <path class="gauge__track" data-track></path>
          <path class="gauge__left" data-left></path>
          <g data-glow class="gauge__glow"></g>
          <g data-slices></g>
          <g class="gauge__pace" data-pace>
            <line data-pace-line></line>
            <text data-pace-text text-anchor="middle">Today</text>
          </g>
        </svg>
        <p class="gauge__end gauge__end--a">$0</p>
        <p class="gauge__end gauge__end--b">$3,200</p>
        <div class="gauge__center" aria-live="polite">
          <p class="gauge__label" data-c-lab>Left to spend</p>
          <p class="gauge__value" data-c-val></p>
          <p class="gauge__note" data-c-note>$95 a day for 12 days</p>
        </div>
      </div>

      <div class="drawer" data-drawer>
        <ul class="legend" data-legend></ul>
        <div class="list" data-list hidden>
          <div class="list__head">
            <button class="list__back" type="button" data-back aria-label="Back to all categories">
              <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M10 3.5 5.5 8l4.5 4.5"></path></svg>
            </button>
            <p class="list__name" data-list-name>Groceries</p>
            <p class="list__count" data-list-count>9 payments</p>
          </div>
          <ul class="list__rows" data-list-rows></ul>
        </div>
      </div>
    </section>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.9Z"></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.

27 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 “Monthly budget gauge” 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 the budget card of Tally, an invented personal finance app: the needle mark, «November budget», «$3,200 planned» and on the right «Day 18 of 30». Below, a dark half ring is the whole month’s budget, from $0 on the left to $3,200 on the right. On arrival the spent part draws itself from the left on a spring that goes a hair too far and comes back: Rent in the brightest lime, then Groceries, Transport and Fun in ever duller tones, with a soft glow underneath and a thread of light on the inner edge; the rest of the ring, what can still be spent, is marked outside by a row of thin dots. A white tick drops with a small bounce where today falls, «Today», and you see at once whether you are spending faster than the month. In the middle «Left to spend» and $1,134 rolling digit by digit, with «$95 a day for 12 days». Below, the legend in two columns: each category with the amount spent, its cap and a small bar that fills on a spring. Point at a slice, or at its entry, and it lifts out of the arc by a few units and thickens with its shadow, the others dim, the entry lights up with an edge of light and the centre rolls to the category’s figure and its share of the budget. A tap opens the payments: the legend drops and fades, the list rises with the back arrow, the name, how many payments and the last three rows with shop, day and amount, one after another on a spring; the centre tells how much is left in that category. A drawn pointer does it all by itself and starts again; it also really works, with mouse, finger and keyboard (Esc closes the list).

How it works

One angle for the whole arc

The entrance does not animate the four slices one by one but a single angle, sweep, going from 180 to the end of the spent part with back.out: each slice shows the piece of sweep that falls between its two angles. So the spring overshoots only with the last slice, like one object, and the earlier slices stay still.

Arc paths rewritten every frame

Each slice is an SVG group with two paths: the thick stroke in its tone and a translucent white thread on the inner edge, the light. onUpdate rewrites the d attribute from angles, thickness and lift; the same path blurred underneath makes the glow, and the row of dots outside the arc starts where sweep arrives.

The slice that lifts with its shadow

On hover the slice goes to a bigger thickness and moves along its bisector with back.out(2.6); it takes a feDropShadow and is moved to the end of the group so its shadow falls on its neighbours. The others drop to a quarter of their opacity, glow included.

The legend that becomes a list

Legend and list share one drawer of fixed height, so the card never changes size: the entries drop and fade staggered, then the header and the payment rows come in from below on a spring. The centre knows when a list is open and tells what is left in the category instead of its share.

The autopilot

A sequence of steps on the tweens’ promises takes the drawn pointer to the real spot of each slice, computed from the angles and the drawing’s size, opens Groceries, goes back, opens Transport from the legend and goes back; the card’s sheen follows it too. At the first real gesture it stops, and starts again after nine quiet seconds.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#c8f169The colour of the spent part: the four slices are its tones, from brightest to dullest.
SPRINGscript.js1.5How far the drawing’s spring goes past the end before settling.
DRAW_TIMEscript.js1.6The seconds the arc takes to draw itself on arrival.
LIFTscript.js5How far the pointed slice lifts out of the arc.
THICKENscript.js4How much the pointed slice thickens.
PAUSEscript.js1.3The seconds the autopilot stays on each slice.

Try them in the Playground

When to use it

For the home of a personal finance or budgeting app, the monthly summary of an online bank, a couple’s or a household’s shared account, any spending cap to keep an eye on day by day.

On phones

The card takes the width of the box, the arc is also measured on the height (at most 52vh) and the drawer underneath is between 108 and 114 pixels tall, so both legend and list fit. A tap on a slice or an entry opens the payments straight away.

With reduced motion

The arc is already drawn and the card fades in; the pointed slice only thickens, without lifting, the others dim, legend and list swap with a fade, the figures change without rolling and the drawn pointer stays hidden.

Pitfalls

  • Animating the slices one after another, each with its own spring, made them overlap the neighbour at every bounce: one angle for the whole arc keeps the spring on the last slice.
  • Spans inside a button are inline: the 2 pixel legend bar did not show until it became display block.
  • With tabular figures Mona Sans draws a slashed zero: the digit columns keep their own width and no tabular-nums.
  • When the list opens the centre must update after the open category is set, otherwise it shows the share instead of what is left.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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