Skip to content
animorio
IT
All components

Print button

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

The «Print» button of Ledgerline, a made-up document editor: an ink pill with a line-drawn printer and, under it, the slot. Press it (or Cmd/Ctrl+P) and a sheet comes out of the slot in jerks like from a real printer, each line printing as it passes the slot, the pill trembling by a pixel at every jerk and «Page 1 of 3» rolling; the three sheets settle on the pile slightly tilted, with their shadow, and the pill turns «Printed» with the tick. On white, with a single vermilion 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>
<!--
  "Print 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>Print 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">
    <!-- the Print button of a made-up document editor, Ledgerline.
         Press it (or Cmd/Ctrl+P): a small sheet comes out of the slot under the pill in steps, like a real printer,
         each line printing as it passes the slot, «Page 1 of 3» rolls, the sheets settle slightly tilted with their shadow,
         and the pill turns «Printed» with the tick -->
    <section class="rig" data-rig aria-label="Print">
      <p class="file"><span class="file__name">Studio_Letter.pdf</span><span class="file__meta">3 pages · A4</span></p>

      <button class="pill" type="button" data-pill aria-keyshortcuts="Control+P Meta+P">
        <span class="pill__face" data-face>
          <span class="icon" aria-hidden="true">
            <svg class="printer" data-printer viewBox="0 0 24 24">
              <path d="M7 9V4.6c0-.33.27-.6.6-.6h8.8c.33 0 .6.27.6.6V9"/>
              <path d="M7 17H5.4A1.4 1.4 0 0 1 4 15.6v-5.2C4 9.63 4.63 9 5.4 9h13.2c.77 0 1.4.63 1.4 1.4v5.2c0 .77-.63 1.4-1.4 1.4H17"/>
              <path d="M7.6 14h8.8c.33 0 .6.27.6.6v4.8c0 .33-.27.6-.6.6H7.6a.6.6 0 0 1-.6-.6v-4.8c0-.33.27-.6.6-.6z"/>
              <path class="printer__led" d="M16.6 11.6h.01"/>
            </svg>
            <span class="done" data-done>
              <svg viewBox="0 0 24 24"><path class="done__tick" data-tick pathLength="1" d="M7.4 12.4l3 3 6.2-6.6"/></svg>
            </span>
          </span>
          <span class="pill__words" data-words>
            <span class="word" data-word="print">Print</span>
            <span class="word" data-word="printing">Printing</span>
            <span class="word" data-word="printed">Printed</span>
          </span>
        </span>
      </button>

      <div class="feeder">
        <span class="slot" aria-hidden="true"></span>
        <div class="out" data-out aria-hidden="true"></div>
      </div>

      <p class="status" data-status aria-hidden="true">
        <span class="status__row" data-row="ready">Office printer <span class="sep">·</span> Ready</span>
        <span class="status__row" data-row="page">Printing page <span class="num" data-num><i><b>1</b></i></span> of 3</span>
        <span class="status__row" data-row="done">3 pages sent to Office printer</span>
      </p>
      <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.

31 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 “Print 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

At the top the file name, «Studio_Letter.pdf», with «3 pages · A4»; below the black «Print» pill with the line-drawn printer and its vermilion light, and below that the dark slot. Hover it and the content rises by a pixel; press it and the pill sinks to 0.95 and comes back with a bounce. On click the label turns into «Printing», the line below says «Printing page 1 of 3» and a sheet comes out of the slot in fourteen jerks: at every jerk the pill trembles by a pixel and the lines that have just passed the slot print from the left. Once it is all out the sheet drops onto the pile and settles slightly tilted with a small bounce and its shadow; the page number rolls and the next sheet comes out. After the third the printer shrinks and in its place comes the vermilion disc with the tick drawing itself, «Printed» and «3 pages sent to Office printer»; a moment later the sheets are taken away and the pill goes back to «Print».

How it works

The slot

Under the pill sits a dark bar, and right under it a container whose clip-path hides only what is above its top edge: the sheet starts at yPercent −100, hidden, and is born from the slot as it moves down.

The jerks

The sheet does not glide: a timeline moves it in steps, each quick with power2.out and then still, and at every step the pill runs a fromTo from 1 px to 0 on y, like a printer’s body.

Lines print at the slot

Each line knows its height on the sheet: when the part that is out goes past that line, in the same step the line grows from scaleX 0 to 1 from the left. The sheet comes out bottom first, so the last lines print first, as if the print head sat in the slot.

The pile

Once it is all out the sheet drops a little with back.out and takes a different tilt for every page; the shadow grows as it settles. The next sheet starts while the first is still landing.

Words and the tick

Print, Printing and Printed sit on top of each other out of the flow, in a box as wide as the visible word that changes on a spring; the printer and the disc with the tick share the same square cell, so neither pushes the other.

Values to change

NameFileDefaultWhat it changes
PAGESscript.js3How many sheets come out of the slot.
STEPSscript.js14In how many jerks a sheet comes out.
STEP_TIMEscript.js0.13Seconds of each jerk of the paper.
TILTscript.js2.2How many degrees the sheets lean on the pile.
PRESSscript.js0.95Scale of the pill while pressed.
SPRINGscript.js0.55How springy the pill is when it changes width.
PRINTED_HOLDscript.js2.4Seconds «Printed» stays.
AUTO_PAUSEscript.js6Seconds of quiet before the demo plays by itself again.

Try them in the Playground

When to use it

In document editors, invoices, tickets and receipts to print, office software: wherever printing is a real action and the person wants to see that it started and how many pages came out.

On phones

Everything is in em and the size depends on both the width and the height of the window, so the pill, the slot and the pile fit the phone box. The sheets move in yPercent, so they follow their own height even if the window changes mid-print. A tap works like a click.

With reduced motion

No jerks or springs: the sheets fade in already on the pile, one after another, with the lines already printed; the labels change at once and the tick appears already drawn.

Pitfalls

  • The sheet is hidden with the container’s clip-path and not with overflow: hidden, because overflow would also crop the tilted sheets on the pile; the clip-path reaches a few em below and to the sides and only cuts above.
  • Moves in yPercent, not pixels: the demo window changes height while you watch and pixels worked out at the start would be wrong.
  • The hidden labels are out of the flow in a box as wide as the visible word: a hidden nowrap label in the flow would widen the pill and push the icon off centre.
  • With stroke-dashoffset and pathLength 1 autoRound has to be off, or the tick pops in at once.
  • Cmd/Ctrl+P has to be stopped with preventDefault, or the browser opens its print dialog.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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