
The elastic button
Buttons, Hover, Text
The queue ticket button of an office: press it and the ticket feeds out of the slot in three pushes, as from a small printer; the people ahead, bars in a row, leave one by one while the minutes go down, and when it is your turn the pill turns green and names the desk.
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>
<!--
"Take a number 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>Take a number 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">
<!-- a "take a number" button: the ticket feeds out of the slot in three pushes, the people ahead
leave the queue one by one, and when it is your turn the pill turns green and names the desk -->
<button class="tn" type="button" data-tn>
<span class="tn__slot" aria-hidden="true">
<span class="tn__paper" data-paper><b data-code>A47</b></span>
<i class="tn__slit"></i>
</span>
<span class="tn__text">
<span class="tn__line tn__line--a"><span data-a>Take a number</span></span>
<span class="tn__line tn__line--b"><span data-b>Registry office</span></span>
</span>
<span class="tn__queue" data-queue aria-hidden="true"></span>
<span class="tn__wave" data-wave aria-hidden="true"></span>
</button>
<p class="live" data-live aria-live="polite"></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.
14 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 “Take a number button” from Animorio and fit it into my siteThe ticket sits in a box with hidden overflow above the slit and rises on yPercent in three tweens separated by a pause: 62, 30, 0, the last with back.out. The pinked edge is a clip-path.
Each person ahead is a bar. When a number is called the first rises and is removed from the DOM; the others start from their old position and slide to the new one on a spring.
The pill’s ground is a color-mix between paper and green driven by a CSS variable from 0 to 1, which GSAP animates: the same number also tints the shadow below.
| Name | File | Default | What it changes |
|---|---|---|---|
GO | script.js | #3ddc84 | The colour of your turn. |
TICKET | script.js | A47 | The number printed on the ticket. |
AHEAD | script.js | 4 | How many people are ahead, from 1 to 6. |
CALL | script.js | 0.9 | How many seconds between one number called and the next. |
DESK | script.js | 3 | The desk to go to. |
HOLD | script.js | 2.2 | How many seconds it stays on your turn before going back to ready. |
LOOP | script.js | true | Left alone, a pointer takes a number and waits for its turn. |
In the app or site of a town hall, a post office, a bank, a clinic or a shop with a queue at the counter; and wherever people wait for a turn: a restaurant table, a fitting room, support.
The same button: 64 pixels tall, at most as wide as the screen, one whole tap target; long lines are cut with an ellipsis.
No pushes, springs or waves: the ticket is already out, the bars disappear one at a time without sliding and the green arrives at once.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 4.7 KB; the libraries: GSAP 28 KB.
Tested on 18 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.