Skip to content
animorio
IT
Back to the library

Error stack trace

Text, HoverGSAP, CSS onlyMediumCompressed weight: Demo 6.3 KBGSAP 28 KBFreeDownload the zip

An error’s stack trace, in a card on warm white, minimal style: the type and the message at the top, below the call stack from the most recent, with the library calls folded into a single row that opens. At the bottom, on a dark ground, the three lines of code of the call in view: the one that failed is lit and a wavy underline is uncovered under the exact spot. Pointing at a call changes the code; tapping it keeps it chosen.

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>
<!--
  "Error stack trace" 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>Error stack trace</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">
    <!-- an error's stack trace: the message, the calls that led to it with the library ones folded into one row,
         and for the frame you point at the lines of code with a wavy mark under the exact spot -->
    <section class="tr" data-tr aria-label="Error stack trace">
      <header class="tr__head">
        <span class="tr__kind" data-kind>TypeError</span>
        <strong>Cannot read “total” of undefined</strong>
      </header>
      <ol class="tr__frames" data-frames aria-label="Call stack, most recent first"></ol>
      <div class="tr__code" data-code aria-live="off">
        <span class="tr__file"><span class="tr__clip"><span data-outfile>cart/summary.js</span></span></span>
        <div class="tr__lines" data-lines></div>
      </div>
    </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.

11 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 “Error stack trace” 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 warm white, a white rounded card: a red pill “TypeError” and under it “Cannot read “total” of undefined”. Then the call stack, monospaced: “renderCart” with “summary.js:42” on the right, already chosen and red-bordered; “updateTotals”, “store.js:118”; a lighter row with a small arrow, “Library frames”, and on the right “9 hidden”; “onClick”, “Button.js:27”. At the bottom a dark box: “cart/summary.js:42” and three lines of code with their numbers; the middle one, “return format(order.total);”, is lit and under “order.total” there is a red wavy underline. On entering the pill gives a small start and the underline is uncovered from left to right. Pointing at “updateTotals” tints the row and the code changes: “cart/store.js:118”, with the underline under “renderCart(cart)”. Tapping “Library frames” turns the arrow and three smaller rows open one after the other, “callCallback”, “dispatchEvent”, “batchedUpdates”; pointing at one, in place of the code you read that it is library code. Tapping “onClick” moves the red border there; folding the libraries again takes the three rows back in.

How it works

A stack of objects

Every call is an object: function, file, line and, if it is your code, the three lines around it and the piece that failed.

Folded libraries

The library calls are rows of zero height: opening them means taking them to their height one after the other, and closing them the other way.

Looking and choosing

Pointing at a call shows its code without changing the choice; tapping fixes it. On leaving, the chosen one comes back.

The wavy mark

The wrong piece is wrapped in an element with CSS’s wavy underline, uncovered from the left with an animated clip.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#d8402fThe colour of the error.
OPENscript.js0.45How many seconds the library rows take to open and close.
STAGGERscript.js0.05How many seconds pass between one row and the next as they open.
LOOPscript.jstrueLeft alone, the demo’s pointer points at a call, opens the library ones and chooses the last.

Try them in the Playground

When to use it

On the page of a service collecting a site’s or an app’s errors, in a developer tool’s error screen, in documentation explaining how to read a trace. The same stack with folded rows carries the steps of a claim or an order’s history with the minor stops hidden.

On phones

The card is at most 348 pixels wide and about 290 tall, becoming about 355 with the library rows open. Long names and files are cut with an ellipsis; with a finger a tap on a call chooses it.

With reduced motion

No rows opening slowly and no underline being uncovered: the library rows appear and vanish in one step and the code changes without sliding. The demo’s pointer does not start.

Pitfalls

  • The calls are an ordered list of buttons; the chosen one has aria-current, and the folded row says aria-expanded: keyboard and screen readers follow everything.
  • Closed library rows also leave the Tab order: a zero-height button that takes focus is a trap.
  • Folding the libraries while one of them is chosen takes the choice back to the first call: it cannot stay on a row nobody sees.
  • The code is written as text and escaped before becoming HTML: a name with a less-than sign must not break the page.
  • Error, files and function names are invented.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 1 December 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 animations