
The elastic button
Buttons, Hover, Text
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.
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>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
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 siteThe 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 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 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 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.
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.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #4f5bf0 | The colour filling the button once the event is added. |
DAY | script.js | Thu 14 | The day written in the button and on the flying page. |
OPEN | script.js | 0.5 | The seconds the menu takes to open on its spring. |
FLY | script.js | 0.75 | The seconds of the page’s flight from the choice to the button. |
ARC | script.js | 70 | How many pixels the flight’s arc rises above the straight line. |
BOUNCE | script.js | 1.6 | How much the menu, the button and the labels bounce. |
PAUSE | script.js | 1.8 | The seconds the autopilot shows the added button. |
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.
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.
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.
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.
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.