Skip to content
animorio
IT
All components

Vehicle fitment selector

Forms, Hover, TransitionsGSAP, CSS onlyMediumCompressed weight: Demo 10 KBGSAP 28 KBFreeDownload the zip

The vehicle selector of a made-up car parts and accessories shop, Gearloft, in a white card: “Find parts for your vehicle” and three cascading fields, Make, Model and Year, unlocking one after the other with a glint. Each menu opens on a spring and the chosen item slides from the menu into the field; once the year is set, Shop parts lights up with a light running across it and below it the line “Fits your 2019 Arvel Sora” is born with a tick drawing itself and the compatible parts count rolling up to 1,284. Change empties everything in reverse, from year to make, and the car stays saved as a small pill in My garage that fills the three fields again. Minimal style.

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>
<!--
  "Vehicle fitment 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>Vehicle selector</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 vehicle selector of a made-up car parts shop, Gearloft: Make, Model and Year unlock one after the other,
         Shop parts lights up, a "Fits your ..." line is born with a drawn tick and a rolling parts count,
         Change clears everything in reverse, and the car stays saved as a pill in My garage -->
    <section class="card" data-card aria-labelledby="fit-title">
      <header class="top">
        <span class="brand">
          <svg viewBox="0 0 20 20" aria-hidden="true"><circle cx="10" cy="10" r="7.2"></circle><circle cx="10" cy="10" r="2.4"></circle><path d="M10 2.8v4.8M3.8 13.6l4.1-2.4M16.2 13.6l-4.1-2.4"></path></svg>
          <span data-shop>Gearloft</span>
        </span>
        <span class="top__note">Free returns on parts</span>
      </header>

      <h2 class="title" id="fit-title">Find parts for your vehicle</h2>
      <p class="sub">Pick your car once, see only what fits.</p>

      <div class="fields" data-fields>
        <div class="field" data-field="make">
          <button class="field__btn" type="button" aria-haspopup="listbox" aria-expanded="false" data-btn>
            <span class="field__label">Make</span>
            <span class="field__value" data-value><span class="field__ph" data-ph>Select make</span></span>
            <svg class="field__chev" viewBox="0 0 16 16" aria-hidden="true"><path d="M4.5 6.5L8 10l3.5-3.5"></path></svg>
            <span class="field__sheen" aria-hidden="true"></span>
          </button>
          <div class="menu" role="listbox" aria-label="Make" data-menu></div>
        </div>
        <div class="field" data-field="model">
          <button class="field__btn" type="button" aria-haspopup="listbox" aria-expanded="false" data-btn>
            <span class="field__label">Model</span>
            <span class="field__value" data-value><span class="field__ph" data-ph>Select model</span></span>
            <svg class="field__chev" viewBox="0 0 16 16" aria-hidden="true"><path d="M4.5 6.5L8 10l3.5-3.5"></path></svg>
            <span class="field__sheen" aria-hidden="true"></span>
          </button>
          <div class="menu" role="listbox" aria-label="Model" data-menu></div>
        </div>
        <div class="field" data-field="year">
          <button class="field__btn" type="button" aria-haspopup="listbox" aria-expanded="false" data-btn>
            <span class="field__label">Year</span>
            <span class="field__value" data-value><span class="field__ph" data-ph>Select year</span></span>
            <svg class="field__chev" viewBox="0 0 16 16" aria-hidden="true"><path d="M4.5 6.5L8 10l3.5-3.5"></path></svg>
            <span class="field__sheen" aria-hidden="true"></span>
          </button>
          <div class="menu menu--grid" role="listbox" aria-label="Year" data-menu></div>
        </div>
      </div>

      <button class="shop" type="button" disabled data-shopbtn>
        <span class="shop__bg" aria-hidden="true"><span class="shop__light"></span></span>
        <span class="shop__label">Shop parts</span>
        <svg class="shop__arrow" viewBox="0 0 16 16" aria-hidden="true"><path d="M3 8h9M8.5 4.5L12 8l-3.5 3.5"></path></svg>
      </button>

      <div class="fit" data-fit aria-hidden="true">
        <div class="fit__in" data-fit-in>
          <svg class="fit__tick" viewBox="0 0 28 28" aria-hidden="true"><circle cx="14" cy="14" r="11.5" pathLength="1" data-ring></circle><path d="M9 14.4l3.3 3.2 6.6-6.9" pathLength="1" data-check></path></svg>
          <div class="fit__text">
            <p class="fit__line">Fits your <b data-car>2019 Arvel Sora</b></p>
            <p class="fit__count"><span class="odo" data-odo aria-hidden="true"></span> compatible parts<span class="sr" data-count-sr></span></p>
          </div>
          <button class="change" type="button" data-change>Change</button>
        </div>
      </div>

      <div class="garage">
        <span class="garage__label">
          <svg viewBox="0 0 20 20" aria-hidden="true"><path d="M3 9.2L10 4l7 5.2V16H3z"></path><path d="M6.4 16v-3.6h7.2V16"></path></svg>
          My garage
        </span>
        <span class="garage__empty" data-empty>No cars saved yet</span>
        <div class="garage__pills" data-garage></div>
      </div>
    </section>

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

37 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 “Vehicle fitment 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 a white background, a white card with a soft layered shadow: at the top the wheel mark of Gearloft, a made-up car parts shop, and Free returns on parts; the title “Find parts for your vehicle”, the line “Pick your car once, see only what fits.” and three light grey fields, Make, Model and Year, with a small label above and a chevron on the right. Only Make is live, the other two are veiled. Tapped, the field takes a black outline, the chevron turns with a small bounce and the menu opens on a spring, its items arriving one after the other: the five makes with their number of models, the make’s models with their body style (Hatchback, Sedan, SUV, Coupe), the eight years in a grid. The chosen item flies from the menu into the field, the old text leaves upwards, and once there it settles by a pixel; the next field unlocks with a glint running across it and a two-pixel hop. Once the year is set, Shop parts turns from grey to black, the arrow comes in, the pill swells elastically and a light crosses it; below it the green line “Fits your 2019 Arvel Sora” is born on a spring with the circle and tick drawing themselves and the compatible parts count, 1,284, whose digits roll like an odometer one after the other. The car goes in My garage as a small pill at the bottom of the card. Change empties the fields in reverse, year first, then model, then make, the locks coming back and the line closing; the garage pill fills the three fields again in order. Changing the make halfway clears model and year. With the keyboard the menus open with Enter or the down arrow, the arrows run through the items and Esc closes.

How it works

A real cascade

Each field keeps its state in one object (make, model, year): a field is unlocked only when the one before is set, and changing the make clears model and year. The model menu is built when it opens, with the models of the chosen make.

The item sliding into the field

The item’s label in the menu and the spot it will land on in the field are measured with getBoundingClientRect; a position fixed copy flies from one to the other with x, y and a scale that brings its size to the field’s, then it goes away and the real text settles by a pixel with back.out.

Rolling digits

The count 1,284 becomes one column per digit, each with two rounds of 0 to 9 in a strip; GSAP moves each strip with yPercent to the second round of its digit, one column after the other, so the digits turn like an odometer without any pixel sizes.

The line being born and the reverse cascade

The “Fits your…” line has zero height: it is measured at auto height and GSAP brings it there with back.out, then sets it back to auto. Change empties the fields from last to first, CASCADE_GAP apart, and locks them again in the same order; the tick draws with strokeDashoffset on pathLength 1 paths with autoRound off.

Values to change

NameFileDefaultWhat it changes
SHOP_NAMEscript.jsGearloftThe shop’s name at the top of the card.
SPRINGscript.js1.5How far the menus and the “Fits your…” line overshoot and come back.
MENU_TIMEscript.js0.5How long a menu takes to open.
SLIDE_TIMEscript.js0.55How long the chosen item takes to slide from the menu into the field.
COUNT_TIMEscript.js1.3How long the digits of the parts count roll.
CASCADE_GAPscript.js0.14The gap between one field and the next when Change empties everything in reverse.
GARAGE_MAXscript.js2How many cars stay saved in My garage.

Try them in the Playground

When to use it

In an online shop for car parts, tyres, accessories and car care, on the page of a garage or a car wash, and anywhere a product has to be chosen by something you own (the model of a motorbike, a phone, a printer).

On phones

The card takes the width with a margin and heights, gaps and type also follow the window height with clamp, so with the “Fits your…” line open everything fits the preview box; the menus stay inside the card. Touch replaces hover.

With reduced motion

No springs, hops or flights: the menus, the items, the line and the pill fade in, the tick is already drawn, the count already shows its number and the self-running preview does not start.

Pitfalls

  • The preview builds its timeline before the menus exist: the position of the item to reach is read from the data (makes, models, years), not from the menu, which is only created when it opens.
  • The text flying from the menu to the field is a position fixed copy: with the real text already in the field but transparent, the landing spot is measured right even if the field uses a different size.
  • A field’s menu must sit above the fields below it: the open field takes a higher z-index, otherwise the next field, which has its own GSAP transform, comes in front.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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