Skip to content
animorio
IT
All components

Inventory table

Tables, HoverGSAP, CSS onlyMediumCompressed weight: Demo 5.5 KBGSAP 28 KBFreeDownload the zip

A small warehouse’s inventory as a table on white: for every product its name and code, how many pieces there are out of how many fit, a bar and the state written in colour, “In stock”, “Low” or “Out”. The “Receive” button records the incoming delivery: the count climbs, the bar follows it, and the moment it passes the threshold the label rolls into “In stock” and the summary at the top updates.

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>
<!--
  "Inventory table" 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>Inventory table</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 inventory of a small warehouse: the product rows, the stock bar, Receive making the count
         climb and the label going from Low to In stock -->
    <section class="iv" data-iv aria-label="Inventory">
      <header class="iv__head"><strong>Inventory</strong><span class="iv__sum"><span data-outsum>2 low · 1 out</span></span></header>
      <table class="iv__table">
        <thead><tr><th scope="col">Product</th><th scope="col">Stock</th><th scope="col"><span class="sr">Action</span></th></tr></thead>
        <tbody data-body></tbody>
      </table>
    </section>
    <span class="live" aria-live="polite" data-live></span>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.200 19.200 11l-6.300 1.600-3.300 5.900Z"></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.

15 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 “Inventory table” 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, a rounded card: “Inventory” and on the right the summary, “2 low · 1 out”. Below, a table with four products. In every row: the name and under it the code (“HL-204”); then “6 of 60” with the state in colour beside it, “Low” in amber, and a thin bar of the same colour; on the right a small dark button, “Receive 48”. On entering the bars fill one after the other. Tapping “Receive 30” on the serving board’s row, which is at zero and “Out” in red, presses the button in and turns it light with a tick and “Done”; the count climbs from 0 to 30, the bar lengthens, and as soon as it passes the reorder threshold red and amber give way to green, the label rolls into “In stock” and the summary at the top becomes “2 low”. With the napkins’ delivery “1 low” is left.

How it works

A real table

The rows are a table with its headers, written by the script from a list: code, name, pieces, capacity, reorder threshold and incoming delivery.

The state is computed

Zero pieces is out, below the threshold is low, above it is fine. The state is an attribute on the row changing one colour variable: the label and the bar take it from there.

The count carries it all

Receiving stock animates a number from the old count to the new one. On every frame the count and the bar are rewritten and the state recomputed: the label changes at the exact moment the threshold is passed.

The summary at the top

How many rows are low and how many are out is recounted on every state change, and the text rolls only if it changed.

Values to change

NameFileDefaultWhat it changes
GOODscript.js#128a5eThe colour of “In stock”.
LOWscript.js#d48806The colour of “Low”.
OUTscript.js#d9432fThe colour of “Out”, out of stock.
COUNTscript.js0.9How many seconds the count takes to climb when stock arrives.
SPRINGscript.js1How much the bar and the button bounce.
LOOPscript.jstrueLeft alone, the demo’s pointer receives two deliveries and then starts again.

Try them in the Playground

When to use it

In the back office of an online store, a workshop or a warehouse, on the stock page; the same table with its bar and state carries the seats left for several events, the credits of several accounts, the space on several drives or the licences used by several teams.

On phones

The card is at most 348 pixels wide and about 290 tall, and narrows with the screen: the table has fixed-width percentage columns and long names truncate with an ellipsis. The buttons are 32 pixels tall inside 50-pixel rows.

With reduced motion

No climbing count and no bounces: on delivery the number, the bar and the label are the new ones at once and the button fades to “Done” with the tick already drawn. On entering the bars are already filled. The demo’s pointer does not start.

Pitfalls

  • The state is written in words, not a coloured dot in front of the row: “Low” and “Out” can be read without seeing the colours.
  • Every button carries the product in its aria-label (“Receive 48 Linen napkin set”): four identical “Receive” buttons would say nothing to a screen reader user. An aria-live region gives the delivery recorded and the new count.
  • The count never exceeds the shelf’s capacity: the delivery stops there.
  • Products, codes and quantities are invented; in a real back office the delivery is recorded on the server and the count shown has to be its own.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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