
The elastic button
Buttons, Hover, Text
A split button, black on white, in the style of product interface pieces: Publish on the left, the chevron on the right. The chevron opens a two-item menu on a spring, Publish now and Schedule for later; pick the second and the paper plane becomes a clock with a turning hand while the label rolls into Schedule with the day and time in a small pill. Pressed, a green sheet fills the button from the left and everything ends on Scheduled, with a drawn check and the line below saying when it will go live.
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>
<!--
"Schedule publish 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 Publish button with a choice of when</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">
<!-- one gesture: publish. A split button: the left part publishes, the chevron opens a small menu to choose
when; picking Schedule turns the button into Schedule with the time, and pressing it fills the button and
ends on Scheduled -->
<div class="frame" data-inquadra>
<div class="split" data-split>
<span class="fill" data-fill aria-hidden="true"></span>
<button class="main" type="button" data-main aria-describedby="quando">
<span class="ico" aria-hidden="true">
<svg class="ico__send" data-send viewBox="0 0 20 20"><path d="M3.2 9.6 16.6 3.4 12.4 16.8 9.6 11Z"></path><path d="m9.6 11 3.2-3.4"></path></svg>
<svg class="ico__clock" data-clock viewBox="0 0 20 20"><circle cx="10" cy="10" r="6.6"></circle><g data-hand><path d="M10 6.4V10l2.4 1.6"></path></g></svg>
<svg class="ico__check" data-check viewBox="0 0 20 20"><path d="m5 10.4 3.2 3.1L15.2 6.6"></path></svg>
</span>
<span class="labels" data-labels>
<span class="label" data-l="publish">Publish</span>
<span class="label" data-l="schedule">Schedule <span class="when" data-when>Tue 9:00</span></span>
<span class="label" data-l="busy">Publishing</span>
<span class="label" data-l="done">Scheduled</span>
<span class="label" data-l="live">Published</span>
</span>
</button>
<span class="cut" aria-hidden="true"></span>
<button class="more" type="button" data-more aria-haspopup="menu" aria-expanded="false" aria-label="Choose when to publish">
<svg viewBox="0 0 20 20" aria-hidden="true"><path d="m6 8.2 4 4 4-4"></path></svg>
</button>
</div>
<div class="menu" data-menu role="menu" aria-label="When">
<button class="opt" type="button" role="menuitemradio" aria-checked="true" data-opt="now">
<svg viewBox="0 0 20 20" aria-hidden="true"><path d="M3.2 9.6 16.6 3.4 12.4 16.8 9.6 11Z"></path></svg>
<span class="opt__t"><b>Publish now</b><small>Everyone sees it right away</small></span>
<svg class="tick" viewBox="0 0 20 20" aria-hidden="true"><path d="m5 10.4 3.2 3.1L15.2 6.6"></path></svg>
</button>
<button class="opt" type="button" role="menuitemradio" aria-checked="false" data-opt="later">
<svg viewBox="0 0 20 20" aria-hidden="true"><circle cx="10" cy="10" r="6.6"></circle><path d="M10 6.4V10l2.4 1.6"></path></svg>
<span class="opt__t"><b>Schedule for later</b><small>Tomorrow, 9:00 AM</small></span>
<svg class="tick" viewBox="0 0 20 20" aria-hidden="true"><path d="m5 10.4 3.2 3.1L15.2 6.6"></path></svg>
</button>
</div>
<p class="note" id="quando" data-note aria-live="polite">
<span class="note__a" data-note-a>Autumn notes, draft saved 2 min ago</span>
<span class="note__b" data-note-b>Goes live tomorrow at 9:00 AM</span>
</p>
</div>
<svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.9Z"></path></svg>
</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.
26 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 “Schedule publish button” from Animorio and fit it into my siteThe container is the black pill with hidden overflow; inside there are two real buttons, Publish and the chevron, split by a one-pixel line, white at 20%. The green progress sheet sits under both, across the whole pill, with scaleX from 0 to 1 and the origin on the left.
The five labels (Publish, Schedule, Publishing, Scheduled, Published) sit on top of each other in a 20-pixel box with hidden overflow. The leaving one rises by 110%, the arriving one comes from below, narrow (wdth 80), and widens, and GSAP takes the box width to the new one with a back.out: that is the pill stretching on a spring.
The menu has its transform-origin under the chevron (82% 0) and grows from scale .92 and y -6 to 1 and 0 with back.out; the two items arrive 0.06 seconds apart. The chevron turns 180 degrees, and a press outside the menu or Esc closes it.
Paper plane, clock and check are three SVGs in the same spot: only one stays visible, coming in from scale .5 and -30 degrees with back.out. The clock hand turns around its centre with svgOrigin, the check draws itself with strokeDashoffset.
A drawn pointer opens the menu, passes over Publish now, picks Schedule for later, presses the button, waits for Scheduled and then presses again to go back to the start. A real touch stops it; after eight quiet seconds it starts again from Publish.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #12a36b | The colour filling the button, of the check and of the line below. |
WHEN | script.js | Tue 9:00 | The day and time written in the button when scheduling. |
OPEN | script.js | 0.5 | How many seconds the menu takes to open on its spring. |
SEND | script.js | 1.1 | How many seconds the green sheet takes to fill the button. |
BOUNCE | script.js | 1.6 | How much the menu and the arriving label bounce. |
PAUSE | script.js | 1.6 | The seconds the autopilot leaves Scheduled on screen. |
In the editor of a blog or a CMS, in a tool for scheduling social posts, in newsletters, wherever you can publish now or later: it is the split button of real software, with the main action on the left and the choice on the right.
The button stays 44 pixels tall, comfortable for a finger, and the 252-pixel menu fits in the box; the drawn pointer never leaves the window.
No springs or turns: the menu fades in and out, labels and icons swap by fading, the green fills the button in three tenths and the drawn pointer does not start.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.3 KB; the libraries: GSAP 28 KB.
Tested on 27 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.