Skip to content
animorio
IT
All components

Follow hashtag button

Buttons, SVG, HoverGSAP, CSS onlyEasyCompressed weight: Demo 4.4 KBGSAP 28 KBFreeDownload the zip

The button that follows a hashtag: a tile with the hash sign, the name, how many people follow it and “Follow”. On tap the four strokes of the hash regroup into a tick, each on its own spring, the tile turns lime green, “Follow” rolls into “Following” and the count goes up by one. Tap again and the tick goes back to a hash.

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>
<!--
  "Follow hashtag 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>Follow hashtag 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 button that follows a hashtag: the four strokes of the hash regroup into a tick,
         Follow becomes Following and the count of followers rolls up by one -->
    <button class="hb" type="button" data-hb aria-pressed="false">
      <span class="hb__tile" aria-hidden="true">
        <svg viewBox="0 0 24 24"><line data-l></line><line data-l></line><line data-l></line><line data-l></line></svg>
      </span>
      <span class="hb__text"><b>slowtravel</b><span class="hb__sub"><span data-count>12,480</span> following</span></span>
      <span class="hb__chip"><span class="hb__roll"><span data-label>Follow</span></span></span>
    </button>

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

15 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 “Follow hashtag 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: on the left a rounded tile with the white hash sign, then “slowtravel” with “12,480 following” below, on the right a white chip, “Follow”. On opening the four strokes of the hash grow from their centre. Tap the button and it tightens slightly and bounces; the two slanted strokes and the two horizontal ones slide and shorten until they overlap on the two arms of a tick, one after the other, going slightly past and back; the tile turns lime green and gives a small settling turn, the chip empties into a lime outline with “Following” rolling in place of “Follow”, the count goes to 12,481 and the pill’s edge lights up. Tap again and everything goes back. With the pointer over it, the hash tilts.

How it works

Four strokes, two shapes

The hash is made of four line elements. Each has two sets of coordinates: where it sits in the hash and where it ends up in the tick, two on the short arm and two on the long one.

The change

GSAP animates each stroke’s four coordinates in an array, on an elastic spring with a small delay from one to the next, and writes them into the x1, y1, x2, y2 attributes on every frame.

The state

aria-pressed on the button: CSS takes the colours of the tile, the chip and the edge from it; the script the rolling label and the count, which goes up by one and is also read in the label.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#c8f04fThe colour of the followed hashtag.
FOLLOWERSscript.js12480How many people follow it before you.
MORPHscript.js0.7How long the hash takes to regroup into the tick.

Try them in the Playground

When to use it

At the top of a topic page on a blog, a community or a social app, in the list of topics to follow at sign-up and next to each tag of an archive; and wherever something with a symbol of its own is followed.

On phones

The same button, 64 pixels tall and about 290 wide: it fits a phone screen and the whole button is tappable, not just the chip. A longer name is cut with an ellipsis.

With reduced motion

No springs and no travelling strokes: the hash becomes the tick at once, the colours change, the label and the count go to the new value without rolling. The demo’s pointer does not start.

Pitfalls

  • Hashtag and numbers are made up: on a real site the count comes from the server, and it is worth showing the plus one right away and correcting it if the request fails.
  • Followed is not told by colour alone: the icon and the label change, and the button’s label says so with the count.
  • The four strokes end up overlapping in pairs: with a semi-transparent line the double layer would show, so the strokes’ colour is solid.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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