Skip to content
animorio
IT
Back to the library

Redrawing feature icons

SVG, HoverGSAPEasyCompressed weight: Demo 4.8 KBGSAP 28 KBFreeDownload the zip

A minimal hover animation for a product’s feature grid: six features of an invented notes app, Halden, each with a small thin line icon and two words. On hover every stroke of the icon erases itself fast and writes itself again slowly, one after the other, starting from the last; the icon takes the blue accent and the two words step one pixel to the right.

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>
<!--
  "Redrawing feature icons" 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>Features with icons that redraw themselves</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="scena" data-stage>
    <section class="blocco" aria-labelledby="titolo">
      <header class="testa" data-head>
        <p class="marchio">Halden Notes</p>
        <h1 class="titolo" id="titolo">Built to keep up</h1>
      </header>

      <!-- six features: on hover the strokes of the icon erase and redraw, the last stroke first -->
      <ul class="griglia" data-grid>
        <li class="voce" data-cell>
          <span class="filo" data-hair></span>
          <svg class="icona" viewBox="0 0 24 24" aria-hidden="true">
            <path d="M4.6 10.4A7.5 7.5 0 0 1 18.3 7.4"/>
            <path d="M18.7 3.6V7.8H14.5"/>
            <path d="M19.4 13.6A7.5 7.5 0 0 1 5.7 16.6"/>
            <path d="M5.3 20.4V16.2H9.5"/>
          </svg>
          <span class="nome">Live sync</span>
        </li>
        <li class="voce" data-cell>
          <span class="filo" data-hair></span>
          <svg class="icona" viewBox="0 0 24 24" aria-hidden="true">
            <path d="M14 12A5 5 0 1 1 4 12A5 5 0 1 1 14 12"/>
            <path d="M20 12A5 5 0 1 1 10 12A5 5 0 1 1 20 12"/>
          </svg>
          <span class="nome">Shared spaces</span>
        </li>
        <li class="voce" data-cell>
          <span class="filo" data-hair></span>
          <svg class="icona" viewBox="0 0 24 24" aria-hidden="true">
            <path d="M16.5 10.5A6 6 0 1 1 4.5 10.5A6 6 0 1 1 16.5 10.5"/>
            <path d="M7.7 9.3A3 3 0 0 1 9.4 7.6"/>
            <path d="M15 15L19.8 19.8"/>
          </svg>
          <span class="nome">Instant search</span>
        </li>
        <li class="voce" data-cell>
          <span class="filo" data-hair></span>
          <svg class="icona" viewBox="0 0 24 24" aria-hidden="true">
            <path d="M8.5 10.5V7.6A3.5 3.5 0 0 1 15.5 7.6V10.5"/>
            <path d="M6.6 10.5H17.4A1.6 1.6 0 0 1 19 12.1V18.9A1.6 1.6 0 0 1 17.4 20.5H6.6A1.6 1.6 0 0 1 5 18.9V12.1A1.6 1.6 0 0 1 6.6 10.5Z"/>
            <path d="M12 14.4V16.6"/>
          </svg>
          <span class="nome">Private vault</span>
        </li>
        <li class="voce" data-cell>
          <span class="filo" data-hair></span>
          <svg class="icona" viewBox="0 0 24 24" aria-hidden="true">
            <path d="M7.2 18H16.8A3.5 3.5 0 0 0 17.2 11A5.4 5.4 0 0 0 6.8 10.6A3.7 3.7 0 0 0 7.2 18Z"/>
            <path d="M4.5 4.5L19.5 19.5"/>
          </svg>
          <span class="nome">Works offline</span>
        </li>
        <li class="voce" data-cell>
          <span class="filo" data-hair></span>
          <svg class="icona" viewBox="0 0 24 24" aria-hidden="true">
            <path d="M20 12A8 8 0 1 1 4 12A8 8 0 1 1 20 12"/>
            <path d="M12 7.4V12L15.1 14"/>
          </svg>
          <span class="nome">Version history</span>
        </li>
        <li class="filo filo-fondo" data-hair aria-hidden="true"></li>
      </ul>
    </section>
    <p class="nota" data-note>Hover a feature</p>
  </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.

21 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 “Redrawing feature icons” 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 empty warm white the feature grid of Halden Notes, an invented notes app, arrives: above, the app’s name in grey and the title ‘Built to keep up’; below, six features in two rows of three (three rows of two on a phone), divided by thin rules that draw themselves from the left. Each feature has a small thin line icon, drawn in strokes, and two words: the two circling arrows of Live sync, the two overlapping circles of Shared spaces, the magnifier with its glint for Instant search, the padlock of Private vault, the crossed-out cloud of Works offline, the clock of Version history. On arrival every icon writes itself stroke by stroke. When the pointer passes over a feature every stroke of its icon erases itself in 200 milliseconds, speeding up toward its end, and writes itself again from its start in half a second, slowing down: one after the other, 20 milliseconds apart, starting from the last stroke. Meanwhile the icon turns blue and the two words gain a little weight and step one pixel to the right on a spring; leaving, they go back. A press squeezes the icon a little, it bounces back and redraws again. If nobody touches it, an invisible pointer passes over the six features one by one; then all the icons erase, the rules pull back and the grid starts again.

How it works

One stroke, one dash

Every stroke of the icon is a path. The script reads its length with getTotalLength and gives it a dash as long as itself and a slightly longer gap: with the offset at zero it all shows, at minus the length plus one the dash has left through the end, at plus the length plus one it has not come in from the start yet.

Out fast, in slow

On hover every path gets two GSAP tweens on strokeDashoffset: toward its end in 0.2 seconds with expo.in, faster and faster, then a jump to the entry point and in over 0.5 seconds with expo.out, braking until it stops.

Last to first

The paths are taken in reverse and each one starts 20 milliseconds after the one before: the last stroke drawn is the first to go. So the icon never disappears all at once, and the wake runs backwards.

Caught halfway

If the pointer comes back while a stroke is still coming in, the stroke goes back the way it came instead of passing through full again: the script looks at the sign of the offset before choosing the way.

The choreography apart

The main timeline carries the title, rules, words and the invisible pointer through calls; the strokes have tweens of their own. A real hover stops them with killTweensOf, and if they lived inside the timeline the next round would go with them.

Values to change

NameFileDefaultWhat it changes
ERASEscript.js0.2Seconds a stroke takes to erase itself.
REDRAWscript.js0.5Seconds a stroke takes to write itself again.
STAGGERscript.js0.02Seconds between one stroke and the next, starting from the last.
NUDGEscript.js1How many pixels the two words step.
STROKEscript.js1.5The thickness of the icon strokes.
VISITscript.js1.15Seconds the invisible pointer stays on each feature.
LOOPscript.jstrueErase everything and start again after the round.

Try them in the Playground

When to use it

For the features section of a SaaS product, an app or a service, or for menu items with icons: wherever icons should answer a hover with care, without changing shape or filling the page.

On phones

The same animation with adapted sizes: the grid goes to two columns and three rows, and on a tap the icon redraws and squeezes a little.

With reduced motion

The grid appears already drawn, in a fade; on hover the icon only changes colour, without erasing or moving.

Pitfalls

  • The dash must go one pixel past the end and past the start: stopped exactly on the edge, with round caps, it leaves a dot.
  • killTweensOf on a path also stops its tweens inside a timeline: the strokes must be animated outside the main timeline, called by it.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 31 October 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 animations