
The elastic button
Buttons, Hover, Text
One button, one sign, in the simple style of product interface pieces: the black «Duplicate» pill of a documents app, with a sheet and its folded corner drawn in a few strokes. On tap the sheet splits in two, the copy slides to the bottom right and the original steps back, both a hair too far; a thin line in the accent colour runs down the copy and writes its lines while the label reads «Duplicating», then the copy’s corner folds down with a snap and «Duplicated» arrives.
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>
<!--
"Duplicate 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 Duplicate button with the sheet that splits in two</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" data-stage>
<!-- one button, one sign: the sheet splits in two, the copy slides out and its lines are written in -->
<button class="dup" type="button" data-dup data-autoclic aria-label="Duplicate">
<span class="dup__body" data-body>
<svg class="dup__icon" viewBox="4.5 4.5 23 23" aria-hidden="true">
<g transform="translate(9.5 8)">
<g data-sheet="original">
<path class="dup__sheet" d="M1.5 0H9L13 4V14.5A1.5 1.5 0 0 1 11.5 16H1.5A1.5 1.5 0 0 1 0 14.5V1.5A1.5 1.5 0 0 1 1.5 0Z"/>
<path class="dup__fold" d="M9 0V3A1 1 0 0 0 10 4H13"/>
<path class="dup__line" d="M3 8H10"/>
<path class="dup__line" d="M3 10.6H10"/>
<path class="dup__line" d="M3 13.2H7.4"/>
</g>
<g data-sheet="copy">
<path class="dup__sheet" d="M1.5 0H9L13 4V14.5A1.5 1.5 0 0 1 11.5 16H1.5A1.5 1.5 0 0 1 0 14.5V1.5A1.5 1.5 0 0 1 1.5 0Z"/>
<path class="dup__fold" data-fold d="M9 0V3A1 1 0 0 0 10 4H13"/>
<path class="dup__line dup__line--copy" data-line d="M3 8H10"/>
<path class="dup__line dup__line--copy" data-line d="M3 10.6H10"/>
<path class="dup__line dup__line--copy" data-line d="M3 13.2H7.4"/>
<path class="dup__scan" data-scan d="M2 5.6H11"/>
</g>
</g>
</svg>
<span class="dup__label" aria-hidden="true">
<span class="dup__word" data-word="idle">Duplicate</span>
<span class="dup__word" data-word="busy">Duplicating</span>
<span class="dup__word" data-word="done">Duplicated</span>
</span>
</span>
</button>
<p class="dup__status" role="status" aria-live="polite" data-status></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>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.
17 values to change
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 “Duplicate button” from Animorio and fit it into my siteThe icon is an SVG with two identical groups, the original and the copy, sitting on top of each other at rest. The copy is filled with the pill’s colour but with fill-opacity at zero: as soon as it moves it fills in 16 hundredths of a second while sliding, so it only covers the original where it has already left, and the lines underneath never vanish all at once.
Copy and original go in opposite directions by the same amount, 2.7 and 2.3 units times SPREAD, with back.out: the copy leaves four hundredths earlier on a livelier spring, the original follows, heavier. The drawing stays centred in the icon even once split.
The accent line goes down 8.6 units in WORK seconds with power1.inOut. Each line of the sheet has strokeDasharray equal to its length and starts at a full strokeDashoffset: it is written when the accent line reaches its height, worked out from the line’s position, so the two stay in step for any value of WORK.
The copy’s folded corner scales up from zero around its vertex (svgOrigin 13 0) with back.out: that is the snap of the done state. The three words share one grid cell; the old one rises and leaves, the new one comes up from below at wdth 75 and weight 420 and lands at 100 and 560, and the pill takes the width of the new word measured in its final shape.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #4f7cff | The colour of the thin line that writes the copy. |
LABEL_IDLE | script.js | Duplicate | The word at rest. |
LABEL_BUSY | script.js | Duplicating | The word while the copy is being made. |
LABEL_DONE | script.js | Duplicated | The word once the copy is there. |
WORK | script.js | 1.1 | How many seconds the copy takes to be written. |
SPREAD | script.js | 1 | How far apart the two sheets end up: 0.6 close, 1.4 wide. |
SPRING | script.js | 1 | How springy the press and the sheets are: 0.4 calm, 2 very bouncy. |
SPEED | script.js | 1 | The speed of everything: 2 twice as fast, 0.5 half. |
HOLD | script.js | 2 | How many seconds each state stays when the button plays by itself. |
AUTO | script.js | true | The button plays the gesture by itself until someone touches it. |
For the button that makes a copy of a document, a page or a template in a work app: the sign says by itself that there are two sheets now, with no need for a notice.
On the phone the pill and the icon take their size from the screen (clamp on the shorter side); there is no hover, everything else is the same.
The two sheets are already in place and the copy fades in with its lines already written; the words swap with a fade, with no springs or movement.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 5.1 KB; the libraries: GSAP 28 KB.
Tested on 31 October 2026
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.
Support Animorio
Animorio stays free thanks to the people who support it. If you like, buy us a coffee: it helps us make the next animations.
You asked for
We made it for you: it’s in the library, with the preview, the Playground and the code to copy.
An animation you can’t find, or a site to take apart in the journal: tell us which. We pick the next ones from here.
With your account’s email and password.
or with your email
You’re signed in as .
With your account, you can download the zip of every animation and every pack, for free.