Skip to content
animorio
IT
All components

Take a number button

Buttons, HoverGSAP, CSS onlyMediumCompressed weight: Demo 4.7 KBGSAP 28 KBFreeDownload the zip

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.

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>
<!--
  "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>

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.

14 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 “Take a number button” 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, a paper-coloured pill: on the left a dark tile with a slit, in the middle “Take a number” and below “Registry office”. Pressed, the pill gives and comes back on a spring; a white ticket with a pinked edge and the number A47 feeds out of the slit in three pushes, the last with a small bounce; the lines roll to “Ticket A47” and “About 6 min, 4 ahead”, and on the right four bars pop up, the people ahead. On each number called the first bar rises and disappears, the others slide to close the gap, the ticket jolts and the minutes go down, until “You are next”. Then it is your turn: the pill passes to green with a beat of scale, a single wave leaves the edge, the ticket hops and the lines say “Your turn” and “Desk 3, ticket A47”. After a moment everything is ready again.

How it works

The ticket in pushes

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

The line getting shorter

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.

Green in a variable

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.

Values to change

NameFileDefaultWhat it changes
GOscript.js#3ddc84The colour of your turn.
TICKETscript.jsA47The number printed on the ticket.
AHEADscript.js4How many people are ahead, from 1 to 6.
CALLscript.js0.9How many seconds between one number called and the next.
DESKscript.js3The desk to go to.
HOLDscript.js2.2How many seconds it stays on your turn before going back to ready.
LOOPscript.jstrueLeft alone, a pointer takes a number and waits for its turn.

Try them in the Playground

When to use it

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.

On phones

The same button: 64 pixels tall, at most as wide as the screen, one whole tap target; long lines are cut with an ellipsis.

With reduced motion

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.

Pitfalls

  • In the demo numbers are called on a timer: in a real service the place in line comes from the server and the minutes are an estimate, to be stated as such.
  • While waiting, the button has aria-busy and a label that says ticket and people ahead; the turn is announced in an aria-live line, not just by the green.
  • The ticket is 22 pixels wide: three or four characters fit, a longer number goes in the line beside it.

Libraries

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.

Testing

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