Skip to content
animorio
IT
All components

Place order button

Buttons, Hover, TransitionsGSAP, CSS onlyMediumCompressed weight: Demo 5.7 KBGSAP 28 KBFreeDownload the zip

The «Place order · $96.00» button at the bottom of a made-up shop’s checkout, under a short summary with two line-drawn products. Press it and the label leaves while a thin line works inside the pill; then the pill springs open into the «Order confirmed» card, with the tick drawing itself, the order code rolling in one character at a time and «Arrives Tue 1 Dec». Minimal style, on white, with a single ink blue accent.

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>
<!--
  "Place 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>Place order button</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/jetbrains-mono@5.3.0/index.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="stage">
    <!-- the bottom of a checkout: a short summary and the Place order pill.
         Press it: a thin line works inside the pill, then the pill springs open into the Order confirmed card -->
    <section class="card" data-card aria-label="Checkout">
      <header class="card__head">
        <span class="shop">Fenwick Goods</span>
        <span class="step">Review order</span>
      </header>

      <ul class="rows" data-rows>
        <li class="row">
          <span class="thumb" aria-hidden="true">
            <svg viewBox="0 0 24 24"><path d="M6 9h10v6a4 4 0 0 1-4 4h-2a4 4 0 0 1-4-4z"/><path d="M16 11h1.5a2 2 0 0 1 0 4H16"/><path d="M9 4.5c0 1 1 1 1 2M12 4.5c0 1 1 1 1 2"/></svg>
          </span>
          <span class="row__text"><span class="row__name">Stoneware cup</span><span class="row__meta">Oat · Qty 2</span></span>
          <span class="row__price">$48.00</span>
        </li>
        <li class="row">
          <span class="thumb" aria-hidden="true">
            <svg viewBox="0 0 24 24"><path d="M5 8.5h14l-1.2 10.5H6.2z"/><path d="M9 8.5V7a3 3 0 0 1 6 0v1.5"/></svg>
          </span>
          <span class="row__text"><span class="row__name">Waxed canvas tote</span><span class="row__meta">Ink · Qty 1</span></span>
          <span class="row__price">$48.00</span>
        </li>
      </ul>

      <div class="total" data-total>
        <span>Total</span>
        <span class="total__sum">$96.00</span>
      </div>

      <div class="action" data-action>
        <span class="morph" data-morph aria-hidden="true"></span>
        <button class="pill" type="button" data-pill>
          <span class="pill__label" data-label>Place order<span class="pill__dot">·</span>$96.00</span>
          <span class="pill__work" data-work aria-hidden="true"><span data-run></span></span>
        </button>
      </div>

      <div class="done" data-done aria-hidden="true">
        <svg class="done__check" viewBox="0 0 40 40" aria-hidden="true">
          <circle cx="20" cy="20" r="17" pathLength="1" data-ring/>
          <path d="M12.5 20.5l5 5 10-11" pathLength="1" data-tick/>
        </svg>
        <p class="done__title" data-done-line>Order confirmed</p>
        <p class="done__code" data-done-line><span class="done__label">Order</span> <span class="code" data-code></span></p>
        <p class="done__when" data-done-line>Arrives <strong>Tue 1 Dec</strong></p>
        <p class="done__sum" data-done-line>2 items · $96.00 · Card ending 4821</p>
        <button class="done__back" type="button" data-back data-done-line>Back to shop</button>
      </div>
      <p class="sr" aria-live="polite" data-live></p>
    </section>
  </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.

35 values to change

Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI

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 “Place 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

A Fenwick Goods card with «Review order», two product rows (Stoneware cup, Waxed canvas tote) with line icons, the $96.00 total and the blue «Place order · $96.00» pill. Hover it and the label widens while the shadow grows; press it and the pill sinks to 0.97. On click the label lifts away, a thin line runs inside the pill for a second and a half, then the pill springs open until it covers the card: the circle and the tick draw themselves, «Order confirmed» arrives, the code FW-7K4Q-2913 rolls in one character at a time, then «Arrives Tue 1 Dec», the summary on one line and «Back to shop», which folds it back into the pill.

How it works

Three states

The state is a single word, idle, working or done: the click places the order, «Back to shop» or Esc folds it back.

The pill becomes the card

The blue fill is its own element behind the button: when the order is confirmed the card’s position relative to the button row is measured and GSAP springs left, top, width, height and the radius to those values.

The work

No dots: a thin white line runs inside the pill, repeating, until a GSAP delayedCall confirms the order.

The code

Every character of the code is its own element: for a moment it shows random letters, then it lands on its own and drops 3 px with a small bounce, 0.045 s after the previous one.

The tick

The circle and the tick have pathLength 1 and draw themselves as stroke-dashoffset goes from 1 to 0, with autoRound off.

Values to change

NameFileDefaultWhat it changes
WORKscript.js1.4Seconds the line works inside the pill before the confirmation.
PRESSscript.js0.97Scale of the pill while pressed.
SPRINGscript.js0.62How springy the pill opens into the card (lower means more bounce).
ROLLscript.js0.045Seconds between one character of the code and the next.
CODEscript.jsFW-7K4Q-2913The order code that rolls in.
AUTO_PAUSEscript.js6Seconds of quiet before the demo plays by itself again.

Try them in the Playground

When to use it

At the bottom of an online shop’s checkout, in the summary of a booking or a subscription: wherever the last click has to say right away that everything went fine.

On phones

Everything is in em and the size depends on both the width and the height of the window, so the card fits the phone box. A tap works like a click; if the window changes, the open card is measured again.

With reduced motion

No springs or movement: the pill turns into the card with a fade, the tick is already drawn, the code appears whole and the working line stays still.

Pitfalls

  • The opening card is measured when the order is confirmed, not at start: the demo window may have changed height.
  • The working line has repeat: -1: it has to be killed when the order is confirmed or when you go back.
  • With stroke-dashoffset and pathLength 1 autoRound has to be off, or the tick pops in at once.
  • The button under the open card gets tabindex -1, so the keyboard can’t reach it while it’s covered.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, JetBrains Mono (font variabile) 5.3.0.

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

Testing

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