
The star rating
Ratings, SVG, Hover
An editor’s Undo and Redo in a single pill. In the middle the name of the last action, at the sides how many steps can be undone and how many redone. Press Undo and the arrow turns backwards once, the name rolls to the one before and a step hops over the label from one count to the other. Hold to rewind everything; when nothing is left the button shakes its head.
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>
<!--
"Undo redo 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>Undo redo button</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 Undo and Redo of an editor in one pill: the arrow turns back, the name of the action rolls,
and one step hops across from the undo count to the redo count; hold to rewind -->
<div class="ur" data-ur role="group" aria-label="History">
<button class="ur__btn" type="button" data-undo aria-label="Undo">
<svg viewBox="0 0 22 22" aria-hidden="true"><path d="M6 8h7.200a4.300 4.300 0 0 1 0 8.600H9M9.200 4.800 6 8l3.200 3.200"></path></svg>
</button>
<span class="ur__count ur__roll" aria-hidden="true"><span data-ucount>5</span></span>
<span class="ur__label ur__roll"><span data-label>Add shadow</span></span>
<span class="ur__count ur__roll" aria-hidden="true"><span data-rcount>0</span></span>
<button class="ur__btn" type="button" data-redo aria-label="Redo">
<svg viewBox="0 0 22 22" aria-hidden="true"><path transform="matrix(-1 0 0 1 22 0)" d="M6 8h7.200a4.300 4.300 0 0 1 0 8.600H9M9.200 4.800 6 8l3.200 3.200"></path></svg>
</button>
<span class="ur__say" data-say aria-live="polite"></span>
</div>
<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>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.
12 values to change
Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI
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 “Undo redo button” from Animorio and fit it into my siteEverything the pill says comes from how many actions are still done: the two counts, the name in the middle, which button is off and what screen readers hear.
An element made on the spot travels from the starting count to the other: x is linear, y is a sine, so it draws an arc over the label, and halfway it is smaller.
The whole icon rotates 360 degrees around its own centre: backwards for Undo, forwards for Redo. The direction tells which way time goes without reading.
Pointerdown fires one step, after nearly half a second the repeat starts with GSAP’s delayedCall; it stops on release, if the pointer leaves or when the steps run out.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #4f63f5 | The colour of the step that hops from one side to the other. |
DONE | script.js | 5 | How many actions are already done at the start (0 to 5). |
REPEAT | script.js | 0.16 | While holding, how many seconds between one step and the next. |
HOP | script.js | 26 | How high, in pixels, the step hops over the label. |
LOOP | script.js | true | Left alone, the demo’s pointer undoes, redoes and then holds to rewind everything. |
In an editor’s toolbar: a design app, a page builder, a spreadsheet, a photo or text editor. Wherever undoing is frequent and it helps to know how many steps are left.
The same pill, 284 pixels wide: the two discs are 44, easy on a thumb, and holding does not open the system menu.
Numbers and name change at once, the arrow does not turn and the step does not hop; holding works the same. The demo does not move by itself.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 4.8 KB; the libraries: GSAP 28 KB.
Tested on 21 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.
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.