
The elastic button
Buttons, Hover, Text
An article paragraph with two links, on white, in the style of product interface pieces: hovering a link shows a small pill with the domain, and after half a second the pill grows on a spring into the preview card, with the page’s photo, the title, a line and the favicon, gently following the pointer. Moving to the other link the card slides over and changes content without closing; leaving, it shrinks back into the pill and disappears.
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>
<!--
"Link preview tooltip" 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 tooltip that becomes a link preview</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" data-stage>
<!-- an article paragraph with two links: hovering one shows a small pill with the domain, which after a moment grows
into a preview card that follows the pointer a little; moving to the other link slides the card over without closing it -->
<article class="article" data-article aria-label="Slowbeam article">
<p class="article__kicker">Slowbeam <span>/ Field notes</span></p>
<h1 class="article__title">Why slow software feels fast</h1>
<p class="article__text">
Speed is mostly a feeling. Anything under a tenth of a second reads as instant, which is why
<a class="ref" href="#" data-ref="0">the 100 ms rule</a> still shapes how good apps respond to a tap. But calm matters too:
<a class="ref" href="#" data-ref="1">a recent field study</a> found people trust interfaces that settle gently over ones that snap.
</p>
<p class="article__meta">6 min read <span aria-hidden="true">·</span> Oct 2026</p>
<div class="peek" data-peek role="tooltip" aria-hidden="true">
<span class="peek__arrow" data-arrow></span>
<div class="peek__pill" data-pill>
<svg class="fav" data-fav-pill viewBox="0 0 16 16" aria-hidden="true"></svg>
<span data-domain-pill>latency.report</span>
</div>
<div class="peek__card" data-card>
<div class="peek__img" data-img>
<img src="cronometro.webp" alt="A steel stopwatch dial at sixty" width="1024" height="768" decoding="async" data-photo="0">
<img src="diario.webp" alt="A hand writing in a paper diary with a green pencil" width="960" height="640" decoding="async" data-photo="1">
</div>
<div class="peek__body">
<p class="peek__title" data-title>Why 100 ms feels instant</p>
<p class="peek__line" data-line>The numbers behind perceived speed, from taps to page loads.</p>
<p class="peek__src" data-src>
<svg class="fav" data-fav viewBox="0 0 16 16" aria-hidden="true"></svg>
<span data-domain>latency.report</span>
<svg class="peek__out" viewBox="0 0 16 16" aria-hidden="true"><path d="M6 4h6v6M12 4 5 11"></path></svg>
</p>
</div>
</div>
</div>
</article>
<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.
29 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 “Link preview tooltip” from Animorio and fit it into my siteThe pill and the card are the same element: GSAP changes its width, height, corners and place, and inside two layers take turns, the domain line fading and the card parts coming in staggered. So the opening is one spring and not two things replacing each other.
The card sits under the link’s box, shifted so the little arrow lands at a third of its width, and stays inside the article; if there is no room below it opens above and the arrow moves to the bottom edge. A link that wraps has two boxes: the one nearest to the pointer is used.
If the card is already open it does not close: it moves on a light spring, the old content rises five pixels and fades, the new one comes in from below with a stagger. Leaving waits 180 milliseconds, so crossing the gap between two links makes nothing flicker. Both photos already sit in the card, one on top of the other: changing link only means showing the other one, with no wait for it to load.
Both go through the same function, which checks which link the point is on and moves the card with a quickTo that pulls it a few pixels towards the pointer. The autopilot is a timeline that moves the drawn pointer and calls that function on every frame; at the first real touch it stops for eight seconds.
| Name | File | Default | What it changes |
|---|---|---|---|
DELAY | script.js | 0.5 | The seconds the domain pill stays before opening into the card. |
FOLLOW | script.js | 14 | How many pixels the card follows the pointer along the link. |
CARD_WIDTH | script.js | 300 | The width of the preview card, in pixels. |
SPRING | script.js | 1.3 | How far the card overshoots and comes back when it opens: 0 none, 2 a lot. |
ACCENT | script.js | #5b5bd6 | The colour of the lit link. |
PAUSE | script.js | 1 | The seconds the autopilot stays on each link. |
For the links of a blog, an online magazine, a documentation site or a newsletter read on the web: readers see where a link goes before leaving the page.
The paragraph takes the full width and the card narrows to the article’s width minus the margins, with the line under the title on a single line. With no hover, a tap on the link opens the card straight away and a second tap closes it.
No spring and no following: the pill and the card appear and change in short fades, and the new content does not rise.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 7.0 KB; the libraries: GSAP 28 KB.
Tested on 6 November 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.