Skip to content
animorio
IT
All components

Calendar app picker button

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

The button to add an event to your calendar, on white, in the style of real product interface pieces: pressed, it opens on a spring into three choices, the calendar app, the .ics file and the link to copy. The calendar page of the choice comes off, flies in an arc into the button, and the button fills with colour starting from its icon and becomes Added with a check drawing itself.

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>
<!--
  "Calendar app picker 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 Add to calendar button that picks the app</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: add the event. The button opens into three ways of adding it; the one you pick sends its calendar
         page flying into the button, which turns into Added with a check -->
    <div class="frame" data-inquadra>
      <p class="event">
        <b>Northlight Design Night</b>
        <span>Talks and drinks, Thu Nov 14, 6:30 pm</span>
      </p>

      <div class="wrap">
        <button class="add" type="button" data-add aria-haspopup="menu" aria-expanded="false" aria-controls="menu">
          <span class="add__bg" data-bg aria-hidden="true"></span>
          <span class="add__fill" data-fill aria-hidden="true"></span>
          <span class="ico" aria-hidden="true">
            <svg class="cal" data-cal viewBox="0 0 22 22">
              <rect class="cal__body" x="3" y="4.5" width="16" height="14.5" rx="3.2"></rect>
              <path class="cal__ring" d="M7.6 2.6v3.6M14.4 2.6v3.6"></path>
              <g class="cal__sheet" data-sheet>
                <rect x="3.8" y="9" width="14.4" height="9.2" rx="2.4"></rect>
                <path d="M6.6 12h2M10 12h2M13.4 12h2M6.6 15.2h2M10 15.2h2"></path>
              </g>
              <path class="cal__line" d="M3.4 9h15.2"></path>
            </svg>
            <svg class="tick" data-tick viewBox="0 0 22 22"><path d="m5.6 11.4 3.6 3.5 7.4-7.6"></path></svg>
          </span>
          <span class="labels" data-labels>
            <span class="label" data-l="add">Add to calendar</span>
            <span class="label" data-l="added">Added · Thu 14</span>
          </span>
          <svg class="chev" data-chev viewBox="0 0 16 16" aria-hidden="true"><path d="m4.4 6.4 3.6 3.6 3.6-3.6"></path></svg>
        </button>

        <p class="note" id="nota" data-note>
          <span class="note__t" data-note-t="add">Pick where it goes. Reminder 30 min before</span>
          <span class="note__t" data-note-t="app">In your calendar, with a reminder</span>
          <span class="note__t" data-note-t="ics">northlight-design-night.ics downloaded</span>
          <span class="note__t" data-note-t="link">Calendar link copied to clipboard</span>
        </p>

        <div class="menu" id="menu" role="menu" data-menu aria-label="Add to calendar">
          <button class="opt" type="button" role="menuitem" data-opt="app">
            <span class="opt__ico" data-page-from>
              <svg viewBox="0 0 22 22"><rect x="3" y="4.5" width="16" height="14.5" rx="3.2"></rect><path d="M7.6 2.6v3.6M14.4 2.6v3.6M3.4 9h15.2"></path><path d="M8 13.4h6"></path></svg>
            </span>
            <span class="opt__t"><b>Calendar app</b><small>Opens your default calendar</small></span>
          </button>
          <button class="opt" type="button" role="menuitem" data-opt="ics">
            <span class="opt__ico" data-page-from>
              <svg viewBox="0 0 22 22"><path d="M6 3.4h7l4 4V18a1.6 1.6 0 0 1-1.6 1.6H6A1.6 1.6 0 0 1 4.4 18V5A1.6 1.6 0 0 1 6 3.4Z"></path><path d="M13 3.6v3.8h3.8"></path><path d="M11 9.6v6M8.4 13.2 11 15.8l2.6-2.6"></path></svg>
            </span>
            <span class="opt__t"><b>Download .ics</b><small>For Outlook and other apps</small></span>
          </button>
          <button class="opt" type="button" role="menuitem" data-opt="link">
            <span class="opt__ico" data-page-from>
              <svg viewBox="0 0 22 22"><path d="M9.6 12.4a3.4 3.4 0 0 0 4.8 0l2.6-2.6a3.4 3.4 0 0 0-4.8-4.8l-1.2 1.2"></path><path d="M12.4 9.6a3.4 3.4 0 0 0-4.8 0L5 12.2A3.4 3.4 0 0 0 9.8 17l1.2-1.2"></path></svg>
            </span>
            <span class="opt__t"><b>Copy link</b><small>Subscribe from any app</small></span>
          </button>
        </div>
      </div>
    </div>

    <!-- the calendar page that flies from the chosen row into the button -->
    <span class="flyer" data-flyer aria-hidden="true"><i></i><b>14</b></span>
    <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.

27 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 “Calendar app picker 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

On white, an invented design evening, Northlight Design Night, with the date and time in grey; below, the black Add to calendar pill with the calendar icon and a small chevron. On hover the calendar page turns over like a torn-off sheet; pressed, the button squashes and comes back with an elastic, the chevron makes half a turn and a three-row menu opens below on a spring: Calendar app, Download .ics and Copy link, each with its drawn icon and a grey line. When a row is picked its icon dips for a moment and a calendar page with the day, 14, comes off and flies in an arc to the button’s icon, while the menu closes. On arrival the icon squashes and springs back with an elastic, the blue spreads through the button starting from it, a check draws itself where the calendar was and the label becomes Added · Thu 14, with a small breath of the pill; the line below says where the event went. Pressed again, the blue withdraws into the icon and Add to calendar comes back. A drawn pointer does it all by itself, picking a different row each time; it also really works with mouse, touch and keyboard.

How it works

A box as big as the open menu

The button, the line below and the menu sit in a container as tall as the open menu: the menu is absolutely positioned over the grey line, so opening it pushes nothing and the preview frames the open state too.

The menu on a spring

The menu starts at scale 0.9, slightly higher and transparent, with its origin near the icon, and arrives with back.out; the three rows rise eight pixels one after another, five hundredths apart, and the chevron turns half a turn on the same spring.

The page flying in an arc

The centres of the chosen icon and of the button’s icon are measured, then an object with t from 0 to 1 moves the page along a quadratic Bézier curve with its control point seventy pixels above the straight line; meanwhile the page shrinks and straightens up.

The colour starting from the icon

The blue is a layer under the label with clip-path: circle(0% at 24px 50%), centred on the icon; on arrival the circle grows to 160% and covers the button. Going back it does the same in reverse, and the check is a stroke with a strokeDashoffset that draws itself.

Labels swapping

The two labels sit on top of each other in a box with hidden overflow: the outgoing one rises and narrows on the wdth axis, the incoming one comes up narrow from below and widens with back.out, and the box width follows the one measured with offsetWidth.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#4f5bf0The colour filling the button once the event is added.
DAYscript.jsThu 14The day written in the button and on the flying page.
OPENscript.js0.5The seconds the menu takes to open on its spring.
FLYscript.js0.75The seconds of the page’s flight from the choice to the button.
ARCscript.js70How many pixels the flight’s arc rises above the straight line.
BOUNCEscript.js1.6How much the menu, the button and the labels bounce.
PAUSEscript.js1.8The seconds the autopilot shows the added button.

Try them in the Playground

When to use it

For the page of an event, a webinar, a booking or an appointment, in a ticket confirmation or a meeting card: wherever the reader needs to take the date into their own calendar.

On phones

The block is at most 300 pixels and 92% of the screen wide; under 400 pixels the button drops to 44 pixels high and the line below to 12 for the text. The menu takes the full width of the block and a tap does what a click does.

With reduced motion

No flight, springs or bounces: the menu fades in and out, the colour fills the button almost at once, the check and the labels change without moving and the drawn pointer stays hidden.

Pitfalls

  • The flight’s starting point must be measured before the menu closes: afterwards the chosen icon is already moving and the page would start from the wrong place.
  • The container must be as tall as the open menu, because the preview frame is measured only once, at rest: with the menu outside the container the poster would cut it off.
  • The labels must be measured again on document.fonts.ready: measured with the fallback typeface, the pill stays too narrow or too wide.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 6.9 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