Skip to content
animorio
IT
All components

Wishlist price tag button

Buttons, Hover, PhysicsGSAP, CSS onlyMediumCompressed weight: Demo 11 KBGSAP 28 KBFreeDownload the zip

The Add to wishlist button of an invented fashion and design shop, Orrin & Vale, in espresso lacquer on warm paper with light and grain, like a Dribbble shot. From a brass eyelet a price tag hangs on a cotton thread and swings like a real pendulum. Pressed, the heart fills on a spring and the tag spins on itself: on the back it says «We’ll tell you when it drops». Then it turns to the front and the drop arrives: the old price floats up small and is struck through, the big one rolls down digit by digit to the new price, the discount pops in and the tag swings and settles.

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>
<!--
  "Wishlist price tag 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>The add to wishlist button with the dropping price tag</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/fraunces@5.3.0/full.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="stage">
    <!-- the Add to wishlist button of an invented fashion and design shop, Orrin & Vale. A price tag hangs from the
         pill on a thin thread. Pressed, the heart fills on a spring and the tag spins round: on the back, We'll tell
         you when it drops. Then the drop: the old price is struck through, the new one rolls down digit by digit and
         the tag swings and settles. Pressed again, the piece leaves the wishlist -->
    <div class="wt" data-wrap>
      <span class="wt__floor" data-floor aria-hidden="true"></span>

      <svg class="wt__thread" data-thread-svg aria-hidden="true">
        <path class="wt__thread-shade" data-thread-shade d=""/>
        <path class="wt__thread-line" data-thread d=""/>
      </svg>

      <div class="wt__tag" data-tag aria-hidden="true">
        <div class="wt__card" data-card>
          <div class="wt__face wt__face--front">
            <span class="wt__hole"></span>
            <span class="wt__brand" data-brand>Orrin &amp; Vale</span>
            <span class="wt__item" data-item>Linen overshirt</span>
            <span class="wt__rule"></span>
            <span class="wt__price">
              <span class="wt__was" data-was>
                <span data-was-text>$148</span>
                <svg class="wt__strike" viewBox="0 0 40 10" preserveAspectRatio="none"><path data-strike d="M1 6.4 C 12 5.2, 26 4.6, 39 3.6" pathLength="1"/></svg>
              </span>
              <span class="wt__now" data-now></span>
            </span>
            <span class="wt__foot">
              <span class="wt__size" data-size>Sand · M</span>
              <span class="wt__off" data-off>−20%</span>
            </span>
          </div>
          <div class="wt__face wt__face--back">
            <span class="wt__hole"></span>
            <svg class="wt__bell" data-bell viewBox="0 0 24 24">
              <path d="M12 3.6c-3.1 0-5.4 2.4-5.4 5.6v3.4c0 1-.4 1.9-1.1 2.6l-.6.6h14.2l-.6-.6c-.7-.7-1.1-1.6-1.1-2.6V9.2c0-3.2-2.3-5.6-5.4-5.6z"/>
              <path data-clapper d="M10 18.2c.4.9 1.1 1.4 2 1.4s1.6-.5 2-1.4"/>
            </svg>
            <span class="wt__note" data-note>We’ll tell you when it drops</span>
            <span class="wt__watch">Price watch on</span>
          </div>
        </div>
      </div>

      <button class="wt__btn" type="button" data-btn aria-pressed="false" aria-label="Add Linen overshirt to wishlist">
        <span class="wt__body" data-body>
          <span class="wt__fill" aria-hidden="true"></span>
          <span class="wt__light" data-light aria-hidden="true"></span>
          <span class="wt__sheen" aria-hidden="true"><span class="wt__sheen-band" data-sheen></span></span>
          <span class="wt__edge" aria-hidden="true"></span>
          <span class="wt__row">
            <span class="wt__disc" data-disc aria-hidden="true">
              <svg class="wt__heart" viewBox="0 0 24 24">
                <g class="wt__rays" data-rays>
                  <path d="M12 2.2v-1.6"/><path d="M19.2 5.2l1.1-1.1"/><path d="M21.6 12h1.6"/>
                  <path d="M4.8 5.2L3.7 4.1"/><path d="M2.4 12H.8"/><path d="M19.2 18.6l1.1 1.1"/><path d="M4.8 18.6l-1.1 1.1"/>
                </g>
                <path class="wt__heart-fill" data-heart-fill d="M12 20.3c-.3 0-.6-.1-.8-.3C6.4 15.9 3.4 13 3.4 9.4c0-2.7 2.1-4.8 4.7-4.8 1.6 0 3 .8 3.9 2.1.9-1.3 2.3-2.1 3.9-2.1 2.6 0 4.7 2.1 4.7 4.8 0 3.6-3 6.5-7.8 10.6-.2.2-.5.3-.8.3z"/>
                <path class="wt__heart-line" data-heart-line d="M12 20.3c-.3 0-.6-.1-.8-.3C6.4 15.9 3.4 13 3.4 9.4c0-2.7 2.1-4.8 4.7-4.8 1.6 0 3 .8 3.9 2.1.9-1.3 2.3-2.1 3.9-2.1 2.6 0 4.7 2.1 4.7 4.8 0 3.6-3 6.5-7.8 10.6-.2.2-.5.3-.8.3z"/>
                <path class="wt__heart-gloss" data-gloss d="M7.2 8.2c.3-1 1-1.6 1.9-1.8"/>
              </svg>
            </span>
            <span class="wt__words" aria-hidden="true">
              <span class="wt__label" data-label>Add to wishlist</span>
              <span class="wt__label" data-label>In your wishlist</span>
            </span>
            <span class="wt__eyelet" data-eyelet aria-hidden="true"></span>
          </span>
        </span>
      </button>
    </div>
    <p class="sr" aria-live="polite" data-live></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.

34 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 “Wishlist price tag 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 a sheet of warm paper, with a window light from the top left, the edges slightly in shadow and a very fine grain, a single pill button 60 pixels tall, in espresso lacquer with a thin light on its top edge and a soft shadow on the paper. On the left a dark well with a line-drawn heart, in the middle Add to wishlist and, towards the right, a brass eyelet: from there a cotton thread holds a cream card price tag with its brass-reinforced hole. On the tag Orrin & Vale, Linen overshirt in italics, a hairline, the big price $148 and Sand · M. The tag really hangs: it swings like a pendulum, the card lags a little behind the thread and then follows, the thread bows slightly against the motion and its shadow follows on the paper. With the mouse over it the pill lifts by a pixel, a warm light follows the pointer, the heart swells a little and the tag feels the bump; moving across it pushes it. Pressed, the lacquer sinks and springs back, the heart fills with red from the centre with a bounce, seven thin rays widen and vanish, a reflection crosses the pill and the words become In your wishlist. The tag takes the push and spins one and a half turns on its thread, its sides darkening as they turn from the light, and stops on its back: a ringing bell and «We’ll tell you when it drops» in italics, with Price watch on below. Then it turns to the front and the drop arrives: the old price floats up small above the big one and a red line strikes it, the digits of the big price roll down one after the other to $118 settling by a pixel, the tag swings from the hit, the −20% badge pops in and the heart beats once. Pressed again, the piece leaves the wishlist: the heart empties, the price goes back. Until someone touches it, the button goes round by itself.

How it works

The tag as a pendulum

A single gsap.ticker integrates two springs in three substeps, with the step capped at 1/30 s: the thread angle is a damped pendulum (sine of the angle, not linear), the card’s angle under the thread is a stiffer second spring fed with the thread’s acceleration with the opposite sign, so the tag lags and then follows. The ticker writes the tag’s translate and rotate itself: GSAP never touches it. When everything is still it stops integrating.

The bowing thread

The thread is a quadratic SVG path from the eyelet to the tag’s hole: the control point moves sideways in proportion to the pendulum’s speed, so the cotton bends against the motion. The eyelet follows the pill even when it squashes: the starting point is recomputed with the scale and y read through gsap.getProperty.

The spin

The tag (moved by the pendulum) holds the card (moved by GSAP with rotationY and transformPerspective): front and back have backface-visibility hidden. The spin is always an odd number of half turns, so it stops on the back whatever SPIN is; on every frame a CSS variable darkens the face turning away from the light.

The price rolling down

Each digit of the new price is a 1em window holding a column of digits, from the new one at the top to the old one at the bottom: at first the column is moved up (yPercent) and shows the old price, at the drop it slides down to zero with a light back.out, staggered from the left. Digits that do not change stay still, the last one always does a full turn. The old price floats up small and the red line strikes it with strokeDashoffset on pathLength 1.

Going round by itself

A delayedCall starts from the load event: it saves, shows the back for BACK seconds, drops the price, waits HOLD seconds and removes from the wishlist. At the first real touch the loop stops and the button answers only whoever presses it.

Values to change

NameFileDefaultWhat it changes
BRANDscript.jsOrrin & ValeThe shop on the tag.
ITEMscript.jsLinen overshirtThe piece on the tag.
PRICEscript.js148The price before the drop.
DROPscript.js118The price after the drop (the discount is worked out by itself).
CURRENCYscript.js$The sign before the price.
SPINscript.js1.5How many turns the tag makes to show its back: 0.5 a plain flip, 2.5 a twirl.
BACKscript.js1.7Seconds the back stays in view before the drop.
SWINGscript.js1How much the tag swings: 0.3 barely, 1.8 a lot.
SPRINGscript.js1How springy the heart and the pill are: 0.4 calm, 2 very bouncy.
HOLDscript.js3.2In the loop, seconds it stays on the new price before leaving the wishlist.
AUTOscript.jstrueThe button goes round by itself until someone touches it.

Try them in the Playground

When to use it

For the product page of an online fashion, design, furniture or accessories store: it saves the piece to the wishlist, promises to tell you when the price drops, and shows the drop in a memorable way. It also suits sales, timed deals and price alerts.

On phones

On the phone the pill is at most 72% of the screen wide and the tag stays under it, never going out at the sides even when it swings; there is no hover, so at the touch the pill squashes and the tag takes the push, the rest is the same.

With reduced motion

Nothing moves: the tag hangs still, the heart fills with a fade, back and front swap at once with a fade, the price changes in place and the struck old price and the discount fade in.

Pitfalls

  • With the tag moved both by GSAP (the spin) and by the pendulum, one transform wiped out the other: the pendulum writes on the container, GSAP only turns the card inside.
  • At 92 pixels wide the tag wrapped Orrin & Vale and Price watch on onto two lines: it is 100 wide and the small lines never wrap.
  • The old price, small above the big one, touched the top of the dollar sign: the price row is taller and the tag is 136 pixels tall, so the discount badge no longer touches the last digit either.
  • With an even number of half turns the tag came back to its front instead of showing its back: the half turns are always odd.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, Fraunces (font variabile) 5.3.0.

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

Testing

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