Skip to content
animorio
IT
All components

Schedule publish button

Buttons, HoverGSAP, CSS onlyMediumCompressed weight: Demo 6.3 KBGSAP 28 KBFreeDownload the zip

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.

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>
<!--
  "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>

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.

26 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 “Schedule publish 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

In the middle, on white, a black pill split by a thin line: the paper plane and Publish on the left, the chevron on the right. Below, in grey, the draft: Autumn notes, draft saved 2 min ago. Tap the chevron and it turns half a turn while a white menu grows from below on a spring with two items, Publish now (with the green check) and Schedule for later, Tomorrow, 9:00 AM, arriving one after the other. Pick the second and the check hops over, the menu closes, the plane shrinks away and a clock arrives with its hand doing a turn, while the label leaves upwards and Schedule comes in from below, narrow, widening on the wdth axis, with Tue 9:00 in a small light pill; the black pill stretches on a spring. Press it and the half squashes and springs back, a green sheet fills the button from left to right, and at the end the icon becomes a drawn check, the label becomes Scheduled, the button takes a small breath and the grey line below gives way to a green one: Goes live tomorrow at 9:00 AM. Press again and the green withdraws to the right and everything goes back to Publish. With Publish now the label goes through Publishing and ends on Published.

How it works

One pill, two buttons

The 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 labels in a single box

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 growing from the chevron

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.

The three icons

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.

The autopilot

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.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#12a36bThe colour filling the button, of the check and of the line below.
WHENscript.jsTue 9:00The day and time written in the button when scheduling.
OPENscript.js0.5How many seconds the menu takes to open on its spring.
SENDscript.js1.1How many seconds the green sheet takes to fill the button.
BOUNCEscript.js1.6How much the menu and the arriving label bounce.
PAUSEscript.js1.6The seconds the autopilot leaves Scheduled on screen.

Try them in the Playground

When to use it

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.

On phones

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.

With reduced motion

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.

Pitfalls

  • The label width must be measured with offsetWidth: with the half squashed (scale .94) getBoundingClientRect gave it narrower and the new label was cut.
  • The label box must be measured again when the real typeface arrives (document.fonts.ready): before that the pill took the width of the system font.

Libraries

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.

Testing

Tested on 27 October 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