Skip to content
animorio
IT
All components

Start a return button

Buttons, Hover, SVGGSAP, CSS onlyMediumCompressed weight: Demo 9.8 KBGSAP 28 KBFreeDownload the zip

The «Start a return» button of a made-up clothing shop, Norrland Supply. On tap the top edge of the pill opens like the slot of a label printer and a thermal paper shipping label feeds out of it, row by row in small jolts: the shop, the return address, a QR code made of little squares, the return number and a barcode. The paper curls back a little, then it is cut, springs free and lies down tilted with its shadow; the button says «Label ready, drop off by 12 Nov» with a tick that draws itself, and the refund appears underneath.

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>
<!--
  "Start a return 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 Start a return button that prints the shipping label</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 Start a return button of a made-up clothing shop. On tap the top of the pill opens like the slot of a
         label printer and a paper shipping label feeds out of it row by row; then it is cut, springs free and lies
         down tilted, while the pill says the label is ready and the refund waits underneath -->
    <div class="ret" data-ret>
      <div class="feed" data-feed>
        <span class="feed__shadow" data-lshadow aria-hidden="true"></span>
        <div class="label" data-label aria-hidden="true">
          <div class="paper" data-paper>
            <span class="paper__grain"></span>

            <div class="row row--head" data-row>
              <span class="lab__brand">Norrland Supply</span>
              <span class="lab__tag">Return</span>
            </div>
            <span class="rule rule--thick" data-row></span>

            <div class="row row--to" data-row>
              <span class="lab__small">Return to</span>
              <span class="lab__addr lab__addr--name">Norrland Supply Returns</span>
            </div>
            <div class="row" data-row><span class="lab__addr">Dock 3, Hamnvagen 18</span></div>
            <div class="row" data-row><span class="lab__addr">417 64 Gothenburg, Sweden</span></div>
            <span class="rule rule--dash" data-row></span>

            <div class="row row--mid" data-row>
              <svg class="qr" data-qr viewBox="0 0 25 25" shape-rendering="crispEdges"></svg>
              <div class="mid">
                <span class="lab__small">Return no.</span>
                <span class="lab__rma" data-rma>NS-4471-208</span>
                <span class="lab__line">1 item, Merino overshirt M</span>
                <span class="lab__line">Prepaid, 0.8 kg</span>
              </div>
            </div>
            <span class="rule" data-row></span>

            <div class="row row--bars" data-row data-bars-row>
              <svg class="bars" data-bars preserveAspectRatio="none" shape-rendering="crispEdges"></svg>
            </div>
            <div class="row row--digits" data-row><span class="lab__digits" data-digits>4 471208 309157</span></div>

            <span class="paper__curl" data-curl></span>
          </div>
        </div>
      </div>

      <span class="slot" data-slot aria-hidden="true">
        <span class="slot__head" data-head></span>
      </span>
      <span class="warm" data-warm aria-hidden="true"></span>

      <button class="pill" type="button" data-pill aria-label="Start a return for your order from Norrland Supply">
        <span class="pill__skin" aria-hidden="true">
          <span class="pill__grain"></span>
          <span class="pill__edge"></span>
        </span>

        <span class="face rest" data-rest aria-hidden="true">
          <svg class="rest__icon" viewBox="0 0 24 24" data-rest-icon>
            <path class="rest__box" d="M4.5 8.2 12 4.4l7.5 3.8v7.6L12 19.6l-7.5-3.8z"/>
            <path class="rest__seam" d="M4.5 8.2 12 12l7.5-3.8M12 12v7.6"/>
            <path class="rest__back" data-rest-back d="M8.6 6.3 6.2 3.9M6.2 3.9h3.3M6.2 3.9v3.3"/>
          </svg>
          <span class="rest__words" data-rest-words>Start a return</span>
        </span>

        <span class="face busy" data-busy aria-hidden="true">
          <span class="busy__words">Printing label</span>
          <span class="busy__pct" data-pct>0%</span>
        </span>

        <span class="face done" data-done aria-hidden="true">
          <svg class="done__tick" viewBox="0 0 24 24">
            <circle data-tick-ring cx="12" cy="12" r="10.2" pathLength="1"/>
            <path data-tick d="M7.6 12.3l3 3 5.8-6.2" pathLength="1"/>
          </svg>
          <span class="done__text">
            <span class="done__top" data-done-top>Label ready</span>
            <span class="done__sub" data-done-sub>Drop off by 12 Nov</span>
          </span>
        </span>
      </button>

      <p class="refund" data-refund aria-hidden="true">
        <svg class="refund__icon" viewBox="0 0 16 16"><path d="M3 6.2h8.4a2.6 2.6 0 0 1 0 5.2H8.2M5.6 3.6 3 6.2l2.6 2.6"/></svg>
        <span>Refund <b class="refund__sum" data-sum>€64.00</b> once scanned</span>
      </p>
    </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.

36 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 “Start a return 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 white there is only a graphite pill with a small drawn parcel, its orange arrow going back, and the words «Start a return». With the pointer over it the pill rises by a pixel, the words widen and the slot peeks for a moment along its top edge. On tap the pill gives under the finger and comes back on a spring, the words turn into «Printing label» with the percentage, and the top edge opens into a dark slot that overshoots its width by a pixel and settles. The orange line of the print head lights up inside, and a thermal paper label rises out of the slot, row by row, in small jolts, with an orange warmth on the paper just printed: first Norrland Supply and the black RETURN tag, the thick rule, «Return to» and the address, a dashed rule, the QR code made of little squares with the return number NS-4471-208, the item and the weight, then the barcode coming out in three jolts and its digits. The more paper comes out, the more it curls back and shades at the top. When printing ends the head goes out, the paper drops a hair as if cut, then springs free on a spring that passes the mark by a pixel, flattens with a small wobble and lies down tilted with a soft shadow under it; the slot closes. The button says «Label ready» and «Drop off by 12 Nov», with an orange ring and tick drawing themselves, and underneath the line «Refund €64.00 once scanned» rises with its figures rolling in. After a while the label lifts and fades and the button is ready again.

How it works

A box clipped only at the bottom

The label sits in a box as tall as it plus a margin, with clip-path: inset(-400px -400px 0 -400px): it only cuts the bottom edge, which is exactly the slot above the pill. Moved down by its whole height it is hidden; rising, it comes out of the slot as from a printer.

The jolts come from the rows

On load and on every resize the script reads where each printed row ends (offsetTop plus offsetHeight over the label's height) and turns those into the stops of the feed; the barcode gets three. The timeline goes from stop to stop with a short power2.out and a 50 to 100 ms pause, and the head flares again on every jolt.

Everything in cqw

The label is a container: type, margins, QR and barcode are sized in cqw, a share of its width. The script only picks the width (and shrinks it if the window is not tall enough) and the whole label scales with it.

QR and barcode, drawn

A generator with a fixed seed fills a 25 by 25 grid and lays the three corner squares, the timing lines and the alignment square on top; the barcode alternates bars and spaces from one to three units between the guards. Each is a single SVG path with shape-rendering crispEdges.

Curl, cut and lie down

The curl is a rotateX around the bottom edge, with perspective, growing with the paper that is out, and a veil of shade at the top that follows it. At the cut the box stops clipping, the label jumps with a back.out(1.8), the curl goes back to zero with an elastic.out and a second back.out lays it down tilted while the blurred shadow comes in underneath.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js'#ff6a2b'The colour of the print head, the arrow and the tick.
REFUNDscript.js'€64.00'The refund written under the button.
DROP_OFFscript.js'12 Nov'The last day to drop the parcel off.
CURLscript.js1How much the paper curls back coming out: 0 flat, 2 double.
TILTscript.js-4How tilted the label lies, in degrees.
SPEEDscript.js12 is twice as fast, 0.5 half as fast.
HOLDscript.js2.6How many seconds the label stays before the button is ready again.
AUTOscript.jstrueThe printing plays by itself until someone touches the button.

Try them in the Playground

When to use it

On the orders page of an online shop for clothes, shoes or furniture, in the returns centre, behind the confirmation email that leads to the return: anywhere starting a return should feel simple and already done.

On phones

The same pill, 60 pixels tall and almost as wide as the screen, and the same label, which shrinks all together if the height is not enough. A tap starts the printing and another tap on Label ready makes the button ready again; the slot that peeks with the pointer is not there on a phone.

With reduced motion

No slot, no jolts, no springs: the label fades in already printed and lying down, the button's words and the refund line change with a fade, the tick already drawn.

Pitfalls

  • An overflow: hidden to hide the paper under the slot also cut the label when it jumped tilted: the clip-path with a negative inset on three sides only clips below, and at the cut the is-free class removes it.
  • Jolt stops worked out once went wrong after a resize, because the label changes width and, with cqw, the rows change height too: they are read again on every resize and the feed is a fraction, not pixels.
  • The curl's rotateX turns around the bottom edge: with the origin in the middle the label lifted off the slot and left a gap.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 9.8 KB; the libraries: GSAP 28 KB.

Testing

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