Skip to content
animorio
IT
All components

Event RSVP button

Buttons, Hover, SVGGSAP, CSS onlyMediumCompressed weight: Demo 6.1 KBGSAP 28 KBFreeDownload the zip

The button to answer an invitation: a light pill with the question ‘Are you coming?’ and the faces of who is already coming. Pressed, the faces give way to three answers opening one after the other: Going, Maybe, Can’t. Choosing one the answers fold back, the sign takes the answer’s mark and colour, the label says it, and if you are going your avatar springs in at the front of the guests while the number rolls.

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>
<!--
  "Event RSVP 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>RSVP button with three answers opening inside the pill and your avatar joining the guests</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">
    <!-- the RSVP control of an event page: a pill with the question and the faces of who is coming; pressed, the
         faces give way to three answers that open one after the other; choosing one, the answers fold back, the
         sign takes the answer's mark and colour, the label says it, and if you are going your own avatar springs
         in at the front of the guests while the count rolls -->
    <div class="rsvp" data-rsvp data-answer="">
      <span class="rsvp__body" aria-hidden="true"><span class="rsvp__wash" data-wash></span></span>

      <button class="main" type="button" data-main aria-expanded="false">
        <span class="seat" data-seat aria-hidden="true">
          <svg viewBox="0 0 24 24">
            <g data-env><rect x="3.6" y="6" width="16.8" height="12" rx="2.8"></rect><path d="M4.4 7.6 12 13l7.6-5.4"></path></g>
            <path class="seat__mark" data-mark="going" pathLength="1" d="M6.4 12.6 10.4 16.6 17.8 8"></path>
            <path class="seat__mark" data-mark="maybe" pathLength="1" d="M5.6 13.2c2-3.6 4.2-3.6 6.4-1.2s4.4 2.4 6.4-1.2"></path>
            <path class="seat__mark" data-mark="no" pathLength="1" d="M7.4 7.4l9.2 9.2M16.6 7.4l-9.2 9.2"></path>
          </svg>
        </span>
        <span class="label"><span class="label__word" data-word>Are you coming?</span></span>
      </button>

      <div class="opts" data-opts role="group" aria-label="Your answer">
        <button type="button" data-opt="going" tabindex="-1">Going</button>
        <button type="button" data-opt="maybe" tabindex="-1">Maybe</button>
        <button type="button" data-opt="no" tabindex="-1">Can’t</button>
      </div>

      <div class="guests" data-guests aria-hidden="true">
        <span class="face face--me" data-me><b>You</b></span>
        <span class="face face--a"><b>LK</b></span>
        <span class="face face--b"><b>AM</b></span>
        <span class="face face--c"><b>JO</b></span>
        <span class="guests__n"><span data-count>23</span></span>
      </div>
    </div>
    <p class="sr" data-live aria-live="polite"></p>

    <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.

23 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 “Event RSVP 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 light pill 60 pixels tall: on the left, in a dark round seat, an envelope drawn in line, then the question ‘Are you coming?’ and on the right three round coloured faces with initials, overlapping, and the number 23. Tapping the pill the faces narrow and go, the question gives up its room and from the right three pill answers come out, one after the other and each on a spring: Going, Maybe, Can’t. Hovering an answer it takes its colour: violet, amber, grey. Choosing Going the three answers shrink and fold back, the seat turns violet, the envelope goes and a tick draws itself in its place, the seat gives a small elastic kick, the label rolls to ‘You’re going’, the pill’s edge and shadow take the violet. The faces come back, and at the front of the row a violet avatar saying ‘You’ springs in from above, while the number rolls to 24. With Maybe the sign becomes an amber wave, with Can’t a grey cross, and no avatar is added. Another tap reopens the answers to change your mind. Left alone, a pointer opens, chooses Going and after a while everything goes back to the question.

How it works

One pill, four buttons

The pill is a container: inside are the main button (sign and question, with aria-expanded) and the three answer buttons, which enter the Tab order only when open.

The room changing hands

The answers are zero wide at rest: on opening, the faces strip goes to zero and the answers strip to its width with elastic.out. The question in the middle is elastic (flex 1, overflow hidden) and gives up the room by itself.

The answer’s sign

In the seat there are the envelope and three paths: tick, wave and cross. The chosen answer draws itself with stroke-dashoffset and a CSS variable, --tone, gives its colour to seat, edge, shadow and veil.

Your avatar

It is already in the row, zero wide: if you are going it widens to 30 pixels and half a second later scales from 0.3 to 1 dropping 14 pixels, with elastic.out. The number rolls up; if you change answer, it goes back down.

Values to change

NameFileDefaultWhat it changes
ASKscript.jsAre you coming?The question at rest.
GOINGscript.jsYou’re goingThe label if you are going.
MAYBEscript.jsMaybe, notedThe label if maybe.
NOscript.jsCan’t make itThe label if you are not coming.
GUESTSscript.js23How many people are already coming.
ACCENTscript.js#6457f0The colour of those going.
SPRINGscript.js0.8How long the spring of the opening answers lasts, in seconds.
HOLDscript.js2.6By itself: how many seconds the answer stays before starting again.
LOOPscript.jstrueLeft alone, a pointer answers by itself.

Try them in the Playground

When to use it

On the page of an event, a party, a wedding, a meetup or a work dinner: guests answer in two taps and see at once who else is coming. Also good inside an event card in an app.

On phones

The same button: the pill takes at most the screen width minus the margins and the three answers are slightly narrower, but still 42 pixels tall.

With reduced motion

No springs: the answers appear already in place, the sign changes with a fade, the avatar appears without dropping and the numbers change at once.

Pitfalls

  • A button cannot contain other buttons: the pill is a div, and the main button and the answers are siblings.
  • The faces strip goes back to automatic width before your avatar starts widening, or the number would be cut by the clip while the avatar grows.
  • The three answers can be told apart without colour too: each has its sign (tick, wave, cross) and its words.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 6.1 KB; the libraries: GSAP 28 KB.

Testing

Tested on 14 November 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