
The colour columns
Hover, SVG
The October budget card of a made-up personal finance app, white on warm paper: a donut in five tones of deep teal draws itself slice after slice, each going a degree past its end and back. Pointing at a slice, or at its legend row, a thin ink thread with a caret runs round the donut on a spring to embrace it, the slice lifts outward over its shadow, the others darken a touch and the number in the middle rolls to its category.
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>
<!--
"Budget donut chart" 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 budget donut chart with the thread that runs round to the slice</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 October budget card of a personal finance app: a donut of five tones of one colour drawn slice after slice,
a thin ink thread with a caret outside the ring that runs round to embrace the slice you point at, the slice
lifting out over its shadow, the number in the middle rolling to it and the legend answering at once -->
<section class="card" data-card aria-label="Orra, October budget">
<header class="card__head">
<div class="card__brand">
<svg class="card__mark" viewBox="0 0 24 24" aria-hidden="true">
<circle cx="12" cy="12" r="8.2"></circle>
<path d="M12 3.8a8.2 8.2 0 0 1 8.2 8.2"></path>
</svg>
<div>
<p class="card__name">October budget</p>
<p class="card__sub">Orra · Joint account</p>
</div>
</div>
<span class="card__chip">Oct 1 – 31</span>
</header>
<div class="card__body">
<div class="donut" data-donut>
<svg class="donut__svg" viewBox="-6 -6 212 212" aria-hidden="true">
<defs>
<filter id="shade" x="-30%" y="-30%" width="160%" height="160%"><feGaussianBlur stdDeviation="3.2"></feGaussianBlur></filter>
</defs>
<g data-ticks></g>
<circle class="donut__bed" cx="100" cy="100" r="70"></circle>
<g data-shadows></g>
<g data-slices></g>
<circle class="donut__gloss" cx="100" cy="100" r="79.4"></circle>
<circle class="donut__inner" cx="100" cy="100" r="60.4"></circle>
<g class="thread" data-thread>
<path class="thread__arc" data-arc></path>
<path class="thread__end" data-end-a></path>
<path class="thread__end" data-end-b></path>
<g data-caret><path class="thread__caret" d="M100 13.2 96.6 7.4h6.8Z"></path></g>
</g>
</svg>
<div class="donut__center">
<p class="donut__label" data-label>Spent</p>
<p class="donut__value"><span class="donut__cur">$</span><span class="roll" data-roll></span></p>
<p class="donut__note" data-note>of $4,200</p>
</div>
</div>
<ul class="legend" data-legend aria-label="Categories"></ul>
</div>
<footer class="card__foot">
<svg class="card__trend" viewBox="0 0 16 16" aria-hidden="true"><path d="M3 5.5 8 10.5l5-5"></path></svg>
<p class="card__insight"><b>$1,016</b> under budget, moved to Savings</p>
</footer>
</section>
<p class="sr" aria-live="polite" data-live></p>
<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>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.
23 values to change
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 “Budget donut chart” from Animorio and fit it into my siteEach slice is an SVG arc path on radius 70 with a 20 wide stroke, from one angle to another (degrees, clockwise from twelve o’clock), with 2.2 degrees of empty space between neighbours. On entry GSAP runs the end of the arc OVERSHOOT degrees past its place and back, and the path is rebuilt at every step: so the overshoot is always a degree and a half, even on the large slice, and never steps on its neighbour.
The thread is an arc on radius 86 with a radial tick at each end and a caret rotated to its middle. Its two ends are two tweened numbers: the one in the direction of travel arrives in 0.7 of the time with back.out(1.15), the one behind leaves a moment later and lands with back.out(1.7), a touch past and back. Before it sets off the angles are brought back between 0 and 360 and the target is moved by 360 degrees when that makes the way shorter.
At each update of the thread the script checks which of the 72 ticks fall between its two ends (with a modulo, since the thread can cross twelve o’clock): those darken in 0.18 s, the rest go light again in half a second, so the thread leaves a small trail on the dial.
The slice’s group moves along the direction of its middle by LIFT units with back.out(2.2). Underneath, where it was and three units lower, a copy of the slice blurred with feGaussianBlur fades in: the slice seems to rise over its shadow. The other slices move towards a darker tone mixed into their colour by DIM.
The number is four windows one line tall, each holding a strip from 0 to 9 that moves by yPercent -10 per digit, from the right digit to the left one with 45 ms of delay. For amounts under a thousand the thousands window and the comma squeeze to zero width, measured in em at start so they follow the size of the donut.
Each row is an element with tabindex: hover, focus and the arrow keys call the same function as the slices. With a finger a tap lights the slice and keeps it until you tap outside; an 80 ms delay between a leave and an enter stops the thread from closing when moving from one slice to the next. The autopilot stops at the first real gesture and comes back after eight seconds.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #0f766e | The colour of the donut: the five slices are its tones, from darkest to lightest. |
DRAW_TIME | script.js | 0.55 | Seconds each slice takes to draw itself on entry. |
OVERSHOOT | script.js | 1.8 | How many degrees each slice goes past its end before settling back, on entry. |
LIFT | script.js | 4.5 | How far the pointed slice lifts outward, in drawing units (the donut is 200 wide). |
DIM | script.js | 0.24 | How much the other slices darken: 0 not at all, 1 almost black. |
THREAD_TIME | script.js | 0.6 | Seconds the thread takes to run round the donut to the new slice. |
ROLL_TIME | script.js | 0.7 | Seconds the digits in the middle take to roll. |
PAUSE | script.js | 1.5 | Seconds the autopilot stays on each slice. |
For the dashboard or summary page of a finance app, a bank, an expense tracker or a subscription service: anywhere a donut splits a total into a few parts and they need to be read one at a time, with the legend beside it answering together.
The same animation with adapted sizes: the donut stays beside the legend and is sized on the smaller of width and height, the words in the middle follow its size through container units. A tap on a slice or a row lights it and keeps it; a tap outside goes back to the total.
The card fades in with the donut already whole; on hover only colours, shadows and words change with a fade, the thread appears in place without running, no slice lifting and no rolling digits.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 10 KB; the libraries: GSAP 28 KB.
Tested on 11 November 2026
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.
Support Animorio
Animorio stays free thanks to the people who support it. If you like, buy us a coffee: it helps us make the next animations.
You asked for
We made it for you: it’s in the library, with the preview, the Playground and the code to copy.
An animation you can’t find, or a site to take apart in the journal: tell us which. We pick the next ones from here.
With your account’s email and password.
or with your email
You’re signed in as .
With your account, you can download the zip of every animation and every pack, for free.