Skip to content
animorio
IT
All components

Expandable orders table

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

The orders table of a small shop, on white, in the style of real product interface pieces: tapping a row opens below it, on a spring, the order details with the products, the shipping line and the buttons, while the chevron turns and the rows below slide down. Mark shipped rolls the status label from Paid to Shipped and moves the line on; opening another row closes the first.

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>
<!--
  "Expandable orders 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>The orders table with the row that opens</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" data-stage>
    <!-- the orders table of a small shop: a row opens into its details on a spring, the chevron turns, the rows below slide down;
         inside, the items, the shipping line and Mark shipped, which rolls the status label of the row and moves the line on -->
    <div class="wrap" data-wrap>
      <section class="card" data-card aria-label="Fernlow orders">
        <header class="card__head">
          <svg class="card__mark" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 20V9"></path><path d="M12 13c-3.6 0-6-2.2-6-6 3.6 0 6 2.2 6 6Z"></path><path d="M12 11c0-3.4 2.2-5.6 6-5.6 0 3.4-2.2 5.6-6 5.6Z"></path></svg>
          <div>
            <p class="card__brand">Fernlow <span>/ Orders</span></p>
            <p class="card__sub" data-sub>4 orders this week</p>
          </div>
        </header>

        <div class="table" role="table" aria-label="Orders">
          <div class="thead" role="row">
            <span role="columnheader">Order</span>
            <span role="columnheader" class="col-who">Customer</span>
            <span role="columnheader" class="col-date">Date</span>
            <span role="columnheader" class="col-num">Total</span>
            <span role="columnheader">Status</span>
            <span aria-hidden="true"></span>
          </div>
          <div data-rows></div>
        </div>
      </section>
    </div>

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

25 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 “Expandable orders 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 a very light grey background sits the white orders card of Fernlow, an invented home and plant shop: the black mark with its leaf, «4 orders this week» and a table with the columns Order, Customer, Date, Total and Status. The status is not a coloured dot but a written label: Paid on a warm beige, Shipped on a light green. Passing over a row lightly lights its background. Tapping it opens the row: below it the details panel grows on a spring that goes a little past and settles, the chevron on the right turns half a turn and the rows below slide down. Inside, the products with their line drawing, quantity and price, and the shipping: a thin line with four ticks, Ordered, Packed, Shipped, Delivered, filling green up to where the order is, while the parts come in one after another from below. Mark shipped squashes and returns, the row’s label rolls up from Paid to Shipped, widening and changing colour with a small kick, the line moves on to Shipped and the button turns green with Shipped. Opening another row closes the first; Esc closes the open one. A drawn pointer opens order #2040, ships it, opens #2038 and closes it again, then starts over; it also really works, with mouse, touch and keyboard.

How it works

The row is a button

Each row is a button with aria-expanded and its columns in the same CSS grid as the header: it opens with a click, a tap or Enter, and the columns stay aligned. The details panel sits right below it, zero high with hidden overflow.

The spring of the height

On opening, GSAP takes the panel height from its current size to scrollHeight with back.out, so it goes a little past and settles; at the end it sets it to auto, so a resize cannot leave it wrong. At the same time the chevron turns 180 degrees and the parts come in with a stagger.

The rolling label

To change status the label briefly holds both words one above the other in a column twenty pixels per word: the column rises by twenty, the width goes from the old one to auto, and at the end only the new word is left.

Room for the open state

The preview framing is measured once, at rest: so the card’s container takes a minimum height equal to the closed card plus the tallest panel, measured at start and on every resize.

The autopilot

A timeline with repeatRefresh takes the drawn pointer to the rows and buttons reading their real position every time and calls the same functions as real clicks. At the first real touch it stops, and it starts again after eight quiet seconds.

Values to change

NameFileDefaultWhat it changes
SHOPscript.jsFernlowThe shop name at the top of the table.
ACCENTscript.js#2e7d5bThe colour of the shipping line, the Shipped label and the done button.
OPEN_TIMEscript.js0.7The seconds a row takes to open into its details.
STAGGERscript.js0.06The seconds between one detail and the next as they come in.
BOUNCEscript.js1.6How far the row overshoots its height before settling.
PAUSEscript.js1.2The seconds the autopilot waits between one gesture and the next.

Try them in the Playground

When to use it

For an online shop’s orders panel, a restaurant’s or hotel’s bookings, a dashboard’s invoices or tickets: any list in a table where the details are needed only now and then.

On phones

Under 520 pixels the date column goes, the others tighten and the panel stacks products and shipping, with a single product; the rows are sized on the height too (8.2vh between 34 and 42 pixels), so the open table fits in the box.

With reduced motion

No springs and no rolls: the row opens at once and the details fade in, the chevron is already turned, the label swaps word with a fade, the line is already at its point and the drawn pointer stays hidden.

Pitfalls

  • Leaving the panel height in pixels after opening made it wrong on every resize: at the end it is set to auto.
  • The highlight under the pointer must cover the whole row, panel included, not just the button: otherwise the open row looks detached from its details.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 27 October 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