Skip to content
animorio
IT
All components

Course level selector

Forms, Hover, SVGGSAP, CSS onlyMediumCompressed weight: Demo 5.2 KBGSAP 28 KBFreeDownload the zip

A radio group for choosing the level of a language course: beginner, intermediate, advanced. The tile slides under the choice and stretches in the direction of travel, the level bars rise one after the other, the code and the description roll and below the weeks, lessons and words are recounted.

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>
<!--
  "Course level 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>Course level selector with the bars that rise and the description that changes</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">
    <!-- a radio group for the level of a course: the highlight slides to the chosen tile, its bars rise one after
         the other, the description rolls and the plan below is recounted -->
    <form class="lvl" data-lvl onsubmit="return false">
      <header class="lvl__head">
        <span class="lvl__title" id="lvl-title">Your level</span>
        <span class="lvl__code"><span data-code>A1</span></span>
      </header>

      <div class="lvl__row" role="radiogroup" aria-labelledby="lvl-title" data-row>
        <span class="lvl__thumb" data-thumb aria-hidden="true"><span class="lvl__thumb-in"></span></span>
        <label class="opt">
          <input type="radio" name="level" value="0">
          <svg viewBox="0 0 30 24" aria-hidden="true"><rect x="3" y="14" width="6" height="8" rx="2"></rect><rect x="12" y="8" width="6" height="14" rx="2"></rect><rect x="21" y="2" width="6" height="20" rx="2"></rect></svg>
          <span class="opt__name">Beginner</span>
        </label>
        <label class="opt">
          <input type="radio" name="level" value="1">
          <svg viewBox="0 0 30 24" aria-hidden="true"><rect x="3" y="14" width="6" height="8" rx="2"></rect><rect x="12" y="8" width="6" height="14" rx="2"></rect><rect x="21" y="2" width="6" height="20" rx="2"></rect></svg>
          <span class="opt__name">Intermediate</span>
        </label>
        <label class="opt">
          <input type="radio" name="level" value="2">
          <svg viewBox="0 0 30 24" aria-hidden="true"><rect x="3" y="14" width="6" height="8" rx="2"></rect><rect x="12" y="8" width="6" height="14" rx="2"></rect><rect x="21" y="2" width="6" height="20" rx="2"></rect></svg>
          <span class="opt__name">Advanced</span>
        </label>
      </div>

      <p class="lvl__text" aria-live="polite"><span data-text></span></p>

      <footer class="lvl__plan">
        <span class="plan"><b data-weeks>12</b> weeks</span>
        <span class="plan__bar" aria-hidden="true"></span>
        <span class="plan"><b data-lessons>2</b> lessons a week</span>
        <span class="plan__bar" aria-hidden="true"></span>
        <span class="plan"><b data-words>600</b> words</span>
      </footer>
    </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.

23 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 “Course level 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 “Your level” and a code (A1), then a row of three tiles with three bars of growing height and the level’s name, below two lines of description and a line with weeks, lessons a week and words. Choosing a level, the raised tile slides under the choice with a small bounce and stretches the way it goes, the lit bars (one, two or three) rise from the floor one after the other in the accent colour, the code and the description roll up or down depending on the direction, and the three numbers count to their new values. On hover the bars of a tile that is not chosen lean up slightly. They are real radios: arrows and Tab work.

How it works

Real radios underneath

Each tile is a label with a transparent radio input as large as itself inside: click, arrows and screen readers work on their own. The script only listens to the change event.

The tile

A single absolutely positioned element, a third of the row wide: GSAP moves its x with back.out, and its child stretches to 1.12 with the origin on the side it leaves from and comes back with elastic.out. On resize the x is recalculated.

The bars, the words, the numbers

The bars of the chosen tile start from scaleY 0.25 with the origin at the bottom and rise with back.out staggered by 0.07 seconds. Code and description roll in the direction of the change. The numbers count with power2.out, no spring: a count never overshoots.

Values to change

NameFileDefaultWhat it changes
STARTscript.js0The level chosen at the start: 0 beginner, 1 intermediate, 2 advanced.
WEEKSscript.js12How many weeks the first level’s course lasts (the others: plus 4 and plus 8).
ACCENTscript.js#c8f25cThe colour of the chosen level.
SLIDEscript.js0.55How many seconds the tile takes to slide.
PAUSEscript.js1.7Alone: how many seconds it stays on each level.
LOOPscript.jstrueLeft alone, a pointer tries the three levels.

Try them in the Playground

When to use it

In the signup form of an online school or a language course, in the onboarding of a learning app, in any form where the choice is one of three and each choice changes what follows (a plan, a size, a difficulty).

On phones

The same card, as wide as the screen minus the margins; below 360 pixels the texts shrink by a point. The tap chooses, there is no hover.

With reduced motion

The tile appears under the choice without sliding, the bars do not rise, code and description change without rolling and the numbers are already at their value.

Pitfalls

  • The tile has GSAP’s x and its child has the scale: the same element with both would lose the stretch’s origin halfway.
  • If the level changes while the texts are rolling, the previous timeline is taken to its end before the new one starts: otherwise the old text would stay.
  • The radio input covers the whole tile with opacity 0: the focus outline goes on the label with :has(input:focus-visible).

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 5.2 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