Skip to content
animorio
IT
All components

Ring size selector

Pickers, Hover, SVGGSAP, CSS onlyMediumCompressed weight: Demo 5.1 KBGSAP 28 KBFreeDownload the zip

The ring size selector of an online jeweller: six sizes in a row and a drawn gold ring above. Choosing one, the ring widens or tightens on a spring, the dashed rule across it stretches and the inner diameter is recounted in millimetres, with the US size below.

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>
<!--
  "Ring size selector" 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>Ring size selector of a jeweller with the circle that widens and the diameter that counts</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 ring size selector of a jeweller: choosing a size, the drawn ring widens or tightens on a spring, the
         line across it stretches and the inner diameter is recounted in millimetres -->
    <form class="rg" data-rg onsubmit="return false">
      <header class="rg__head">
        <span class="rg__title" id="rg-title">Ring size</span>
        <span class="rg__hint">Measured inside the band</span>
      </header>

      <div class="rg__stage">
        <svg viewBox="0 0 200 130" aria-hidden="true">
          <defs>
            <linearGradient id="rg-gold" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#fbe6a8"></stop><stop offset="0.45" stop-color="#d9a441"></stop><stop offset="1" stop-color="#8a5a12"></stop></linearGradient>
          </defs>
          <ellipse class="ring__shadow" data-shadow cx="100" cy="121" rx="40" ry="4"></ellipse>
          <circle class="ring__band" data-band cx="100" cy="68" r="40"></circle>
          <path class="ring__shine" data-shine d=""></path>
          <g data-stone><path class="ring__claw" d="M-7 4 0 11 7 4"></path><path class="ring__stone" d="M-8 -3 -4 -8h8l4 5-8 9Z"></path><path class="ring__facet" d="M-8 -3h16M-4 -8 0 -3 4 -8"></path></g>
          <g data-rule><path class="ring__rule" data-line d=""></path><path class="ring__tick" data-t1 d=""></path><path class="ring__tick" data-t2 d=""></path></g>
        </svg>
        <p class="rg__mm"><b data-mm></b><i>mm</i></p>
      </div>

      <div class="rg__row" role="radiogroup" aria-labelledby="rg-title" data-row>
        <span class="rg__thumb" data-thumb aria-hidden="true"></span>
      </div>
      <p class="rg__foot"><span data-foot></span></p>
    </form>

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

16 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 “Ring size selector” 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 card: at the top “Ring size”, in the middle a gold ring seen from the front with its stone on top, a glint on the edge and the shadow below, crossed by a dashed rule with two notches and the diameter in millimetres at its centre; below, six European sizes in a row with a raised tile under the chosen one, and a line saying which US size it matches. On opening the ring opens from a small circle. Choosing a size the tile slides, the ring widens or tightens slightly past the size and settles, the stone rises or drops with it, the shadow widens, the rule stretches to the inner edge, the millimetres count with no bounce and the line below rolls in the direction of the change. They are real radios.

How it works

One radius, the whole drawing

A single number, the ring’s radius, redraws everything at each frame: the circle’s r attribute, the arc of the glint, the stone’s position, the shadow and the rule with its notches. No transforms: only attributes, so no origin problems.

The spring of metal

The radius goes to the size with elastic.out(1, 0.6) in 0.8 seconds; the millimetres count with power2.out in 0.45. The shape may overshoot, the number may not.

The real size and the drawn one

The European size is the inner circumference in millimetres, so the diameter is the size divided by pi. In the drawing the difference is multiplied by SPREAD, otherwise two millimetres would not be seen.

Values to change

NameFileDefaultWhat it changes
STARTscript.js54The size chosen at the start (EU: it is the circumference in millimetres).
FIRSTscript.js50The smallest size in the row.
STEPscript.js2How much each size goes up.
SPREADscript.js2.6How much the difference is exaggerated in the drawing (1 would be to scale).
ACCENTscript.js#e6b655The colour of the mark under the chosen size.
PAUSEscript.js1.5Alone: how many seconds it stays on each size.
LOOPscript.jstrueLeft alone, a pointer tries three sizes.

Try them in the Playground

When to use it

On a ring’s page of an online jeweller, in a size guide, wherever a size is a physical measure worth showing (bracelets, straps, hoops, pipes).

On phones

The same card, as wide as the screen; the ring never exceeds 38% of the height and the six sizes stay 40 pixels high.

With reduced motion

The ring is already at its size and changes at once, the millimetres change without counting and the line below without rolling.

Pitfalls

  • The match with the US size is rounded to the half size: the line says “about”, it is not an official chart.
  • The millimetre label sits in an HTML element above the SVG, at the middle of the rule: its vertical percentage is that of the ring’s centre in the viewBox.
  • The tile under the sizes has its x in pixels: it must be recalculated on resize.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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