Skip to content
animorio
IT
All components

Price drop alert button

Buttons, HoverGSAP, CSS onlyMediumCompressed weight: Demo 7.3 KBGSAP 28 KBFreeDownload the zip

The «Notify me if it drops» button under the headphones of an invented shop, on white, in the style of clean product pieces: pressed, it opens into a small card with a price to drag, rolling digits and a mark for the lowest price of the last thirty days that pulls the handle in; Set alert closes it back into «Alert at $199», with the bell swinging and the check drawing itself.

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>
<!--
  "Price drop alert 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 Notify me button for a price drop</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>
    <!-- a product card of an invented shop: the Notify me button opens into a small card with a target price to drag,
         a mark for the lowest price of the last 30 days, and closes back into the pill with the alert set -->
    <section class="product" data-wrap aria-label="Verra Arc headphones">
      <div class="product__row">
        <div class="product__pic" aria-hidden="true">
          <svg viewBox="0 0 64 64">
            <path class="ph-band" d="M14 36V30a18 18 0 0 1 36 0v6"></path>
            <path class="ph-band ph-band--in" d="M18 34v-4a14 14 0 0 1 28 0v4"></path>
            <rect class="ph-cup" x="9" y="33" width="11" height="17" rx="5.5"></rect>
            <rect class="ph-cup" x="44" y="33" width="11" height="17" rx="5.5"></rect>
            <path class="ph-shine" d="M12 37v8"></path>
            <path class="ph-shine" d="M47 37v8"></path>
          </svg>
        </div>
        <div class="product__text">
          <p class="product__brand">Verra</p>
          <p class="product__name">Arc wireless headphones</p>
          <p class="product__price"><span data-now>$249</span><span class="product__note">Lowest in 30 days: $219</span></p>
        </div>
      </div>

      <div class="slot" data-slot>
        <div class="alert" data-alert>
          <!-- the pill -->
          <button class="pill" data-pill type="button" aria-expanded="false">
            <span class="pill__bell" data-bell>
              <svg viewBox="0 0 24 24" aria-hidden="true">
                <g data-bell-body>
                  <path d="M6.5 16.5V11a5.5 5.5 0 0 1 11 0v5.5l1.6 1.8H4.9Z"></path>
                  <path d="M10.2 20.4a2 2 0 0 0 3.6 0"></path>
                </g>
                <path class="pill__check" data-check d="M15.4 6.2l2 2 3.4-3.8"></path>
              </svg>
            </span>
            <span class="pill__label" data-label><span data-label-in>Notify me if it drops</span></span>
          </button>

          <!-- the panel -->
          <div class="panel" data-panel aria-hidden="true">
            <div class="panel__head">
              <p class="panel__ask">Alert me when it’s</p>
              <p class="panel__price" aria-live="polite"><span class="panel__cur">$</span><span class="digits" data-digits></span></p>
            </div>
            <div class="track" data-track role="slider" tabindex="-1" aria-label="Target price" aria-valuemin="149" aria-valuemax="249">
              <div class="track__rail"></div>
              <div class="track__fill" data-fill></div>
              <div class="track__low" data-low><span class="track__tick"></span><span class="track__tag">30-day low</span></div>
              <div class="track__thumb" data-thumb></div>
            </div>
            <div class="panel__foot">
              <p class="panel__save" data-save>Save $0</p>
              <div class="panel__btns">
                <button class="textbtn" data-cancel type="button">Cancel</button>
                <button class="setbtn" data-set type="button">Set alert</button>
              </div>
            </div>
          </div>
        </div>
      </div>
      <p class="product__foot" data-foot>Free returns within 30 days.</p>
    </section>

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

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.

25 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 “Price drop alert 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 white sits the product card of Verra, an invented shop: the black headphones drawn in a light grey square, the name Arc wireless headphones, the $249 price and beside it, small, «Lowest in 30 days: $219». Below, the white «Notify me if it drops» pill with a line-drawn bell. Pressing it squashes the pill a touch and it opens on a spring into a card as wide as the product card: at the top «Alert me when it’s» and the big price, each digit on its own rolling strip; below, a thin slider from 60 to 100 per cent of the price, with the green band of the drop running from the handle to today’s price and a grey mark labelled 30-day low. Dragging the handle rolls the price digit by digit, the line at the bottom says how much you save and the percentage, and near the mark the handle is pulled onto the lowest price with a small elastic snap while the mark and its label turn green. Set alert closes the card back into the pill, which now reads «Alert at $199» with a green border: the bell swings, a green check draws itself beside it and the line under the card becomes «We’ll email you when it hits $199.». Cancel and Esc close it without changing anything. A drawn pointer does it all by itself and starts again; it also really works, with mouse, touch and the arrow keys.

How it works

A slot as tall as the open card

The pill and the card are the same element, absolutely positioned inside a 172-pixel slot: on opening GSAP takes width, height and radius from the pill’s size to the card’s with back.out, and the page below never moves.

Digits on strips

Each digit of the price is a column 0.62 em wide holding a strip from 0 to 9: to show a digit the strip rises 10 per cent for every unit, with a short back.out. Only the column that really changes moves, so while dragging it is mostly the units that roll.

The mark that pulls

When the value gets within three dollars of the thirty-day low, it is set to that exact price: the handle makes a scale snap with elastic.out and the mark takes the accent colour, as if it held a small magnet.

The bell and the check

With the alert set, the pill closes to the width of its new label, measured first on an invisible copy; the bell swings with rotation keyframes that die down around the hook at the top, and the check draws itself with strokeDashoffset.

The autopilot

A timeline with repeatRefresh reads every time where the pill, the handle and the buttons are; it drags a fake value that passes the mark and goes down to the chosen price, and calls the same functions as real gestures. At the first real touch it stops, and it starts again after eight quiet seconds.

Values to change

NameFileDefaultWhat it changes
PRICEscript.js249The product’s price today, in dollars.
LOWscript.js219The lowest price of the last thirty days: the mark on the slider.
TARGETscript.js199The price the autopilot sets the alert at.
ACCENTscript.js#128a5cThe colour of the drop band, the check and the alert’s border.
ROLLscript.js0.42The seconds a digit of the price takes to roll to the new one.
PAUSEscript.js1.2The seconds the autopilot waits between one gesture and the next.

Try them in the Playground

When to use it

For the product page of an online shop, a price comparison app, a wish list, flight or concert tickets that change price: anywhere people want to wait for the right moment to buy.

On phones

The card takes 92 per cent of the width up to 352 pixels and the open card stays 172 pixels tall, so everything fits in the box; the handle is 22 pixels wide but the whole 40-pixel slider band catches the finger. A tap does what a click does.

With reduced motion

No springs and no rolling: the card opens and closes with a fade, the digits change in place, the handle does not snap, the bell does not swing, the check appears without drawing and the drawn pointer stays hidden.

Pitfalls

  • Mona Sans’s tabular figures draw a slashed zero: the columns have a fixed width with the digit centred, without tabular-nums.
  • The closed pill’s width changes with its label: it is measured on an invisible copy before closing, otherwise the spring ended on an old width and the new label wrapped.
  • The mark that pulls the value must act only on arrival: if it always pulled, a nearby price could no longer be picked, and the elastic snap would fire on every move.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 27 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 components