Skip to content
animorio
IT
All components

Rate us prompt

Ratings, Hover, TransitionsGSAP, CSS onlyMediumCompressed weight: Demo 7.2 KBGSAP 28 KBFreeDownload the zip

The small window Fieldnote, a made-up notes app, shows after a while: «Enjoying Fieldnote?» and five line-drawn stars. Hover or drag and the stars fill up to your finger on a short spring that overshoots by a hair, the one under the pointer swells and the word for the rating rolls in below, from Awful to Love it. With four or five stars they ripple in a little wave and the amber «Rate on the App Store» pill arrives; with one, two or three the window stretches on a spring for a «What could be better?» line with its Send button, which closes with a thank-you.

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>
<!--
  "Rate us prompt" 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>Rate us prompt</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 small window a notes app shows after a while: five stars that fill up to the pointer on a short spring;
         four or five stars wave and bring the App Store button, one to three stretch the window for a line of feedback -->
    <section class="prompt" data-prompt role="dialog" aria-labelledby="titolo">
      <div class="prompt__icon" aria-hidden="true">
        <svg viewBox="0 0 32 32"><rect x="7" y="5" width="18" height="22" rx="3.2"/><path d="M11.5 11.5h9M11.5 15.5h9M11.5 19.5h5.5" class="icon__soft"/><path d="M7 9.5h-1.6M7 15.5h-1.6M7 21.5h-1.6"/></svg>
      </div>
      <h1 class="prompt__title" id="titolo">Enjoying Fieldnote?</h1>
      <p class="prompt__sub" data-sub>Tap a star to rate it. It only takes a second.</p>

      <div class="stars" data-stars role="radiogroup" aria-label="Rating">
        <!-- five stars, each an outline with a filled copy inside that grows from the centre -->
        <button class="star" type="button" role="radio" aria-checked="false" aria-label="1 star, Awful" data-star tabindex="0"><svg viewBox="0 0 24 24" aria-hidden="true"><path class="star__line" d="M12 2.9l2.73 5.53 6.1.89-4.41 4.3 1.04 6.07L12 16.82l-5.46 2.87 1.04-6.07-4.41-4.3 6.1-.89L12 2.9z"/><g class="star__fillwrap" data-fill><path class="star__fill" d="M12 2.9l2.73 5.53 6.1.89-4.41 4.3 1.04 6.07L12 16.82l-5.46 2.87 1.04-6.07-4.41-4.3 6.1-.89L12 2.9z"/></g></svg></button>
        <button class="star" type="button" role="radio" aria-checked="false" aria-label="2 stars, Meh" data-star tabindex="-1"><svg viewBox="0 0 24 24" aria-hidden="true"><path class="star__line" d="M12 2.9l2.73 5.53 6.1.89-4.41 4.3 1.04 6.07L12 16.82l-5.46 2.87 1.04-6.07-4.41-4.3 6.1-.89L12 2.9z"/><g class="star__fillwrap" data-fill><path class="star__fill" d="M12 2.9l2.73 5.53 6.1.89-4.41 4.3 1.04 6.07L12 16.82l-5.46 2.87 1.04-6.07-4.41-4.3 6.1-.89L12 2.9z"/></g></svg></button>
        <button class="star" type="button" role="radio" aria-checked="false" aria-label="3 stars, Okay" data-star tabindex="-1"><svg viewBox="0 0 24 24" aria-hidden="true"><path class="star__line" d="M12 2.9l2.73 5.53 6.1.89-4.41 4.3 1.04 6.07L12 16.82l-5.46 2.87 1.04-6.07-4.41-4.3 6.1-.89L12 2.9z"/><g class="star__fillwrap" data-fill><path class="star__fill" d="M12 2.9l2.73 5.53 6.1.89-4.41 4.3 1.04 6.07L12 16.82l-5.46 2.87 1.04-6.07-4.41-4.3 6.1-.89L12 2.9z"/></g></svg></button>
        <button class="star" type="button" role="radio" aria-checked="false" aria-label="4 stars, Good" data-star tabindex="-1"><svg viewBox="0 0 24 24" aria-hidden="true"><path class="star__line" d="M12 2.9l2.73 5.53 6.1.89-4.41 4.3 1.04 6.07L12 16.82l-5.46 2.87 1.04-6.07-4.41-4.3 6.1-.89L12 2.9z"/><g class="star__fillwrap" data-fill><path class="star__fill" d="M12 2.9l2.73 5.53 6.1.89-4.41 4.3 1.04 6.07L12 16.82l-5.46 2.87 1.04-6.07-4.41-4.3 6.1-.89L12 2.9z"/></g></svg></button>
        <button class="star" type="button" role="radio" aria-checked="false" aria-label="5 stars, Love it" data-star data-autoclic tabindex="-1"><svg viewBox="0 0 24 24" aria-hidden="true"><path class="star__line" d="M12 2.9l2.73 5.53 6.1.89-4.41 4.3 1.04 6.07L12 16.82l-5.46 2.87 1.04-6.07-4.41-4.3 6.1-.89L12 2.9z"/><g class="star__fillwrap" data-fill><path class="star__fill" d="M12 2.9l2.73 5.53 6.1.89-4.41 4.3 1.04 6.07L12 16.82l-5.46 2.87 1.04-6.07-4.41-4.3 6.1-.89L12 2.9z"/></g></svg></button>
      </div>

      <!-- the word of the rating, in a small window: the old word leaves upwards, the new one comes from below -->
      <div class="word"><span class="word__rule" data-rule aria-hidden="true"></span><span class="roll" data-word aria-live="polite"><span class="roll__line">&nbsp;</span></span></div>

      <!-- what comes after the rating: one of the two panels grows in -->
      <div class="after" data-after>
        <div class="panel panel--high" data-high aria-hidden="true">
          <button class="pill" type="button" data-store>
            <span class="pill__face" data-store-face>
              <svg class="pill__glyph" viewBox="0 0 16 16" aria-hidden="true"><path d="M5 11 11 5M6.4 5H11v4.6"/></svg>
              <span class="pill__text">Rate on the App Store</span>
            </span>
          </button>
          <button class="ghost" type="button" data-later>Not now</button>
        </div>

        <div class="panel panel--low" data-low aria-hidden="true">
          <label class="field__label" for="nota">What could be better?</label>
          <div class="field">
            <input class="field__input" id="nota" data-input type="text" autocomplete="off" placeholder="Sync was slow on my phone">
            <button class="send" type="button" data-send aria-label="Send">
              <span>Send</span>
              <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3.5 8h8.2M8.6 4.6 12 8l-3.4 3.4"/></svg>
            </button>
          </div>
        </div>

        <div class="panel panel--thanks" data-thanks aria-hidden="true">
          <svg class="tick" viewBox="0 0 20 20" aria-hidden="true"><circle class="tick__ring" cx="10" cy="10" r="8.2"/><path data-tick pathLength="1" d="M6.2 10.3 8.9 12.9 13.9 7.4"/></svg>
          <span>Thanks, we read every note.</span>
        </div>
      </div>
    </section>
  </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

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 “Rate us prompt” 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

A white window with a notebook icon, «Enjoying Fieldnote?», a line below and five empty stars. Hover with the mouse, or drag with a finger, and the stars fill with amber up to the one under the pointer, each growing from its centre on a spring that overshoots slightly; the star under the pointer swells and below, in a small window, the word for the rating rolls in with an amber rule that stretches. Once you choose: with four or five stars they jump one after the other like a wave and the «Rate on the App Store» pill opens with «Not now»; with one, two or three the window stretches on a spring and «What could be better?» arrives with a field and Send, and after sending, «Thanks, we read every note.» stays with a tick drawing itself. The arrow keys move along the stars, Enter chooses. When nobody touches the page a tour tries a low rating with a note and then five stars.

How it works

Filling from the centre

Each star is an outline with a filled copy inside a group GSAP scales from 0 to 1 with svgOrigin at the centre of the viewBox (12 12) and back.out: the full star grows from the centre and overshoots by a hair before settling.

Up to the pointer

The row checks where the pointer is by comparing x with the left edge of each star, so dragging a finger also works between stars; with setPointerCapture the gesture carries on even outside the row.

Room that stretches

Under the stars sits a zero-height container with the three panels stacked: once you rate, the right panel is measured and the height goes there with elastic.out, then the panel comes in with back.out.

The rating word

The word sits in a small window with hidden overflow: the old one leaves upwards and the new one comes from below, or the other way round when the rating goes down.

Values to change

NameFileDefaultWhat it changes
FILLscript.js0.34Seconds each star takes to fill up on its spring.
OVERSHOOTscript.js2.2How far the fill goes past its size before settling.
SWELLscript.js1.14How much the star under the pointer swells.
WAVEscript.js5Pixels the stars jump in the wave after a good rating.
HIGH_FROMscript.js4From how many stars the store button comes instead of the feedback line.
STRETCHscript.js0.75Seconds the window takes to stretch for what comes after the rating.
TYPE_SPEEDscript.js0.045Seconds per letter when the tour types the note.

Try them in the Playground

When to use it

In an app or a web service, after someone has done something good (a week of notes, a finished run, an order delivered): asking for a rating without getting in the way, and sending only happy people to the store while listening to the others first.

On phones

Everything is in em and the size depends on both the width and the height of the window, so the prompt fits the phone box even when open. With a finger you drag across the stars and let go on the rating.

With reduced motion

No springs, waves or swelling: the stars fill with a quick fade, the word changes with a fade, the window stretches without a bounce and the tick appears at once.

Pitfalls

  • The fill scales inside the svg: svgOrigin «12 12», the real centre in viewBox coordinates, not transformOrigin.
  • The panels under the stars are absolute in a zero-height container: they can be measured while hidden with visibility, but the height has to be measured again on resize, because the box changes while you look at it.
  • With a finger the click comes after pointerup: choose on pointerup and ignore the real click, or the rating fires twice.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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