Skip to content
animorio
IT
All components

Track order button

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

The Track order button of an invented online shop, Larkmoor, in porcelain on warm paper in a window light, like a Dribbble shot. Pressed, the pill stretches and turns, inside itself, into the shipping timeline: Ordered, Packed, On the way, Delivered. A small cardboard package slides along the engraved line to the current stop, leans with its inertia and settles on a spring; every stop it reaches fills with a long, flat accent light, and the arrival window rolls in digit by digit. Then the package reaches the door: it lifts away, a check draws itself in its place and the time becomes the delivery time.

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>
<!--
  "Track order 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>The Track order button with the package sliding along the timeline</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 Track order button of an invented online shop, Larkmoor, in porcelain on warm paper. Pressed, the pill
         stretches into a timeline inside itself: Ordered, Packed, On the way, Delivered. A small package slides along
         an engraved line to the current stop and settles on a spring, the arrival window rolls in like a drum, and
         every stop it reaches fills with the accent light. The round ends on the delivery with a drawn check -->
    <div class="tk" data-wrap>
      <span class="tk__floor" data-floor aria-hidden="true"></span>
      <button class="tk__btn" type="button" data-btn aria-expanded="false" aria-label="Track order LK-48210">
        <span class="tk__body" data-body>
          <span class="tk__fill" aria-hidden="true"></span>
          <span class="tk__light" data-light aria-hidden="true"></span>
          <span class="tk__sheen" aria-hidden="true"><span class="tk__sheen-band" data-sheen></span></span>

          <!-- closed: the pill -->
          <span class="tk__closed" data-closed aria-hidden="true">
            <span class="tk__disc" data-disc>
              <svg class="tk__glyph" data-glyph viewBox="0 0 24 24">
                <path class="tk__glyph-box" d="M4.6 8.4 12 4.8l7.4 3.6v7.4L12 19.4l-7.4-3.6z"/>
                <path class="tk__glyph-fold" d="M4.6 8.4 12 12l7.4-3.6M12 12v7.4"/>
                <path class="tk__glyph-tape" d="M8.3 6.6l7.4 3.6v2.6"/>
              </svg>
            </span>
            <span class="tk__words">
              <span class="tk__title" data-title>Track order</span>
              <span class="tk__sub" data-sub>Larkmoor · LK-48210</span>
            </span>
            <svg class="tk__chev" data-chev viewBox="0 0 16 16"><path d="M6 3.8 10.2 8 6 12.2"/></svg>
          </span>

          <!-- open: the timeline inside the pill -->
          <span class="tk__open" data-open aria-hidden="true">
            <span class="tk__top">
              <span class="tk__eta" data-eta>
                <span class="tk__eta-line" data-eta-line="0">
                  <span class="tk__eta-word">Arrives today</span>
                  <span class="tk__time" data-time="14:00–16:00"></span>
                </span>
                <span class="tk__eta-line" data-eta-line="1">
                  <span class="tk__eta-word">Delivered today</span>
                  <span class="tk__time" data-time="14:32"></span>
                </span>
              </span>
              <span class="tk__ref" data-ref>LK-48210</span>
              <svg class="tk__fold" data-fold viewBox="0 0 16 16"><path d="M4.2 9.8 8 6l3.8 3.8"/></svg>
            </span>
            <span class="tk__track" data-track>
              <span class="tk__groove"></span>
              <span class="tk__done" data-done></span>
              <span class="tk__flare" data-flare></span>
              <span class="tk__tick" data-tick></span>
              <span class="tk__tick" data-tick></span>
              <span class="tk__tick" data-tick></span>
              <span class="tk__tick" data-tick></span>
              <span class="tk__pkg" data-pkg>
                <span class="tk__pkg-shadow" data-pkg-shadow></span>
                <span class="tk__pkg-box" data-pkg-box>
                  <svg viewBox="0 0 20 16">
                    <path class="tk__pkg-side" d="M1.5 4.6h17v9.2a1.2 1.2 0 0 1-1.2 1.2H2.7a1.2 1.2 0 0 1-1.2-1.2z"/>
                    <path class="tk__pkg-lid" d="M1 3.4a1.2 1.2 0 0 1 1.2-1.2h15.6A1.2 1.2 0 0 1 19 3.4v1.4H1z"/>
                    <path class="tk__pkg-tape" d="M8.4 2.2h3.2v6.3l-1.6-.9-1.6.9z"/>
                    <path class="tk__pkg-label" d="M3.6 10.4h4.6M3.6 12.4h3"/>
                  </svg>
                </span>
              </span>
              <svg class="tk__check" data-check viewBox="0 0 24 24">
                <circle class="tk__check-ring" data-check-ring cx="12" cy="12" r="9.6" pathLength="1"/>
                <path class="tk__check-mark" data-check-mark d="M7.6 12.3l3 3 5.8-6.2" pathLength="1"/>
              </svg>
            </span>
            <span class="tk__labels">
              <span class="tk__label" data-label>Ordered</span>
              <span class="tk__label" data-label>Packed</span>
              <span class="tk__label" data-label>On the way</span>
              <span class="tk__label" data-label>Delivered</span>
            </span>
          </span>
          <span class="tk__edge" aria-hidden="true"></span>
        </span>
      </button>
    </div>
    <p class="sr" aria-live="polite" data-live></p>
  </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.

30 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 “Track order 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 a sheet of warm paper, with a window light coming in from the top left, a lighter band of light across it and a very fine grain, a single pill button 60 pixels tall in porcelain: lighter at the top, with a white hairline on its upper edge and a soft layered shadow on the paper. On the left an ink disc with a small line drawn package and its orange tape, then Track order and under it, small, Larkmoor · LK-48210, and on the right a little arrow. With the mouse over it a warm light follows the pointer, the pill lifts by a pixel, the package in the disc hops and the arrow leans out. Pressed, the porcelain sinks and springs back, the words slide out sideways and the pill stretches in width and a little in height until it becomes a timeline, still a pill. On top Arrives today with the window rolling in, every digit on its own drum that spins and stops with a small bounce, until 14:00–16:00; on the right the order number and a small arrow to close. Below, a line engraved in the porcelain draws itself from the left, four thin ticks pop up one after another and under them the four stops: Ordered, Packed, On the way, Delivered. A small cardboard package, with its orange tape and its label, drops on the first tick and squashes a touch; then it slides along the line to Packed and to On the way: as it sets off it leans back, as it brakes it tips forward and rocks on a spring before stopping, with a two pixel hop halfway and the shadow under it narrowing. Behind it the line fills with orange, and at every stop it reaches the tick stretches on a spring, the name gets wider and bolder and a long, flat accent light, like an anamorphic flare, moves onto the stop. After a few seconds the delivery arrives: the package slides to Delivered, lifts and disappears, in its place a thin ring draws itself around the end of the line with the check inside, the window slides away upwards and Delivered today 14:32 comes in from below, rolling again, while a reflection crosses the porcelain. Pressed again, the timeline folds back into the pill. Until someone touches it, the button goes round by itself.

How it works

A pill that becomes the line

The button has a single body (.tk__body) whose width and height GSAP moves, from 236 by 60 to the piece’s full width by 88, with a light back.out: the radius stays 999px, so it stays a pill. Inside there are two layers: the closed one, anchored left, and the open one, already as wide as the open pill and centred; the body, with overflow hidden, crops them, so as it stretches the pill uncovers the line instead of squashing it.

Stops measured in pixels

On resize the script measures the piece’s width and its margin (the CSS --pad), places the four ticks a third apart with gsap.set and aligns the names: the first to the left of its tick, the last to the right, the middle ones centred with xPercent -50. A single variable P.p, from 0 to 1, moves the package and the orange part of the line (scaleX from the left), and another moves the accent light.

The package and its inertia

The package slides with a back.out that brakes past the stop and comes back. The tilt is not a tween: a gsap.ticker works out the package’s speed and acceleration and feeds them to a damped spring (angle, angular velocity, stiffness 170, time step at most 1/30 s), so it sets off leaning back, brakes tipping forward and rocks before stopping. When everything is still the ticker writes nothing.

The time on drums

Every digit of the time is a window one line tall over a column of 0-9 twice, with a mask fading top and bottom. The digits spin from right to left, staggered by 60 ms, with a back.out that barely bounces; a zero makes a full turn. On delivery the old line rises and fades, the new one comes in from below and its drums spin again.

The check and the loop

Ring and check are two SVG paths with pathLength 1: they draw with strokeDashoffset from 1 to 0, ring first and then the mark, while the package lifts and shrinks. The loop starts from the load event, opens, waits HOLD seconds on the current stop, delivers, waits and folds back; at the first real touch it stops.

Values to change

NameFileDefaultWhat it changes
SHOPscript.jsLarkmoorThe shop on the closed pill.
ORDERscript.jsLK-48210The order number.
WINDOWscript.js14:00–16:00The arrival window that rolls in.
DELIVERED_ATscript.js14:32The time of the delivery.
STOPscript.js2The stop the package goes to when it opens: 1 Packed, 2 On the way, 3 Delivered.
TRAVELscript.js1Seconds the package takes from one stop to the next.
SPRINGscript.js1How springy the package and the pill are: 0.4 calm, 2 very bouncy.
HOLDscript.js2.4Seconds on the current stop before the delivery arrives.
AUTOscript.jstrueThe button goes round by itself until someone touches it.

Try them in the Playground

When to use it

For an order page or the purchase confirmation of an online shop, a courier’s email or app, the orders summary in an account: it says where the package is without opening another page, when it arrives, and celebrates the delivery.

On phones

On the phone the open pill is 92% of the screen wide, the inner margins tighten, the stop names get a little smaller and the order number top right disappears to leave room for the time; there is no hover, so the light under the finger turns on at the touch and the rest is the same.

With reduced motion

Nothing moves: the pill goes from closed to open at once with the words fading, the package fades out at one stop and back in at the next, the digits of the time are already in place, ring and check appear whole.

Pitfalls

  • The open layer’s width was written as min(640px, 92vw, 100%) in a CSS variable, but a variable with a percentage resolves where it is used: inside the body of the closed pill it meant 236 pixels and the line got squashed. The script measures the piece and writes the width in pixels into --Wpx.
  • With tabular-nums Mona Sans uses fixed width figures that looked like a typewriter face next to the words: the drums do not need them, each column is already as wide as its widest digit.
  • The check above the end of the line touched the small close arrow: now it sits on the line, in place of the last tick, with a porcelain fill that cuts the orange line.
  • With reduced motion the pill closed at once but the words came back after 0.4 s, leaving an empty pill for a moment: there they come back after 0.14 s.

Libraries

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.

Testing

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