Skip to content
animorio
IT
All components

Magic link button

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

The button for signing in without a password: “Email me a magic link”. Press it and the envelope closes and crosses the pill leaving a violet trail, the label becomes “Check your inbox” with the address under it and the envelope a tick. Round the disc a ring runs out: when it ends, the disc springs back and the button offers “Resend link”.

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>
<!--
  "Magic link 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>Magic link button</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 passwordless sign-in button: the envelope crosses the pill leaving a trail, the label becomes
         "Check your inbox" with the address, and a ring runs out before the link can be sent again -->
    <button class="ml" type="button" data-ml>
      <span class="ml__trail" data-trail aria-hidden="true"></span>
      <span class="ml__sheen" data-sheen aria-hidden="true"></span>
      <span class="ml__text">
        <span class="ml__label" data-label>Email me a magic link</span>
        <span class="ml__sub" data-sub aria-hidden="true"></span>
      </span>
      <span class="ml__disc" data-disc aria-hidden="true">
        <svg class="ml__ring" viewBox="0 0 52 52"><circle data-ring pathLength="1" cx="26" cy="26" r="24.500" transform="rotate(-90 26 26)"></circle></svg>
        <svg class="ml__icon" viewBox="0 0 24 24">
          <g data-env><rect x="3.500" y="6" width="17" height="12.500" rx="2.600"></rect><path data-flap d="M4.200 7.600 12 13.200l7.800-5.600"></path></g>
          <path class="ml__tick" data-tick pathLength="1" d="M6.500 12.600l3.700 3.700 7.500-8"></path>
        </svg>
      </span>
    </button>
    <span class="ml__say" data-say aria-live="polite"></span>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.200 19.200 11l-6.300 1.600-3.300 5.900Z"></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.

10 values to change

Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI

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 “Magic link 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 black, a dark pill with a violet shadow beneath: on the left a violet disc with an envelope, then the label “Email me a magic link”. Under the pointer the envelope’s flap lifts, the disc grows slightly and a sheen crosses the pill. On press the pill gives, the flap closes and the disc sets off to the right: a violet trail stretches behind it and then fades. Meanwhile the label rolls into “Check your inbox”, slides left into the space left free and the address appears under it. At the far end the disc settles with a bounce, the envelope becomes a tick drawing itself and a pale ring appears round it, running out over a few seconds. When the ring ends, the disc springs back to the left, the tick turns back into an envelope and the label says “Resend link”. Pressed while waiting, the button just shakes its head slightly.

How it works

The flap

The envelope’s flap is a three-point path: GSAP animates its d attribute between the tip up (open) and the tip down (closed).

The journey

The disc goes right with an x equal to the pill’s width minus sixty pixels, measured at that moment; the trail is a gradient as wide as the pill with scaleX from 0 to 1 from the same side, on the same curve.

The label

The label leaves upwards, changes its text and comes in from below; its container slides 44 pixels left into the space the disc left.

The waiting ring

An SVG circle with pathLength 1: stroke-dashoffset from 0 to 1 over RESEND seconds, linear; at the end it calls the return.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#8f7bffThe colour of the disc, the trail and the shadow under the button.
EMAILscript.jsnora@example.comThe address the link goes to, written under “Check your inbox”.
RESENDscript.js4How many seconds to wait before the link can be sent again (the ring running out).
SPRINGscript.js1How much the disc bounces when it arrives and when it returns: 0.3 = a little, 2 = a lot.
LOOPscript.jstrueLeft alone, the demo’s pointer sends the link, waits for the ring and sends it again.

Try them in the Playground

When to use it

On the sign-in page of an app or service that lets people in with a link sent by email, under the address field; also for “Send reset link” and any sending that cannot be repeated straight away.

On phones

The same button, 286 by 60 pixels at most: on a narrow screen the pill shortens and the disc’s journey is measured again; with a finger the journey, the trail and the ring remain.

With reduced motion

No journey and no trail: on tap the button shows “Check your inbox”, the address and the tick on the right at once; after the wait it goes back to “Resend link”. The demo does not move by itself.

Pitfalls

  • The address is made up (example.com is reserved for examples) and no email is sent in the demo: on a real site the wait before sending again is decided by the server, the button only shows it.
  • While waiting the button has aria-disabled, not disabled: it stays reachable from the keyboard and a screen reader hears the aria-live region saying where the link went.
  • “Check your inbox” should be said even when the address does not exist in the service, or the button reveals who is registered.
  • The disc’s journey is in pixels: it is measured again at every send and on resize, because the pill changes width with the screen.
  • The sheen runs on GSAP’s xPercent: a translation also written in the CSS would add up and the band would stay in view.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 22 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