
The inchworm menu
Menus, Hover, Transitions
The breadcrumbs of Lumen, a made-up documentation site, on white with a single blue accent: opening a folder slides the new level in from the right and the others along; once the path is longer than four levels the middle ones squeeze, fade and gather into a «…» pill that opens a small cascading menu. Clicking a level shortens the path, and a grey pill slides behind the crumb under the pointer. Minimal style.
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>
<!--
"Collapsing breadcrumbs" 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>Collapsing breadcrumbs</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 breadcrumbs of a made-up docs site, Lumen: the path grows as you open a folder, the middle levels fold
into a «…» pill when it no longer fits, the pill opens a small menu of the hidden levels, and a click on any
level walks the path back -->
<section class="doc" data-doc aria-label="Lumen documentation">
<header class="bar">
<span class="brand">
<svg class="brand__mark" viewBox="0 0 20 20" aria-hidden="true"><path d="M4 3.5h7.5a4.5 4.5 0 0 1 4.5 4.5v8.5H8.5A4.5 4.5 0 0 1 4 12Z"/><path class="brand__cut" d="M8 8h4.5M8 11.2h3"/></svg>
<span>Lumen</span><span class="brand__sub">Docs</span>
</span>
<span class="bar__search" aria-hidden="true">
<svg viewBox="0 0 16 16"><circle cx="7" cy="7" r="4.6"/><path d="m10.4 10.4 3.2 3.2"/></svg>
<span>Search</span><kbd>/</kbd>
</span>
</header>
<nav class="trail" aria-label="Breadcrumb">
<div class="trail__track" data-track>
<span class="trail__pill" data-pill aria-hidden="true"></span>
<ol class="trail__list" data-list></ol>
</div>
<div class="menu" data-menu role="menu" aria-label="Hidden levels" hidden></div>
</nav>
<div class="page" data-page>
<div class="page__head">
<h1 class="page__title"><span class="roll" data-title></span></h1>
<p class="page__meta" data-meta></p>
</div>
<ul class="rows" data-rows></ul>
</div>
<p class="sr" aria-live="polite" data-live></p>
</section>
</main>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
<script src="script.js"></script>
</body>
</html>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.
17 values to change
Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI
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 “Collapsing breadcrumbs” from Animorio and fit it into my siteEach level is an li with overflow hidden: GSAP takes its width from 0 to the size of its content (or back) with back.out, so the others slide along without computing positions. When it settles the width goes back to auto.
The path folds when it has more levels than MAX_VISIBLE or when the real widths add up to more than the bar: the levels between the first and the last go to width 0, their text squeezes to scaleX 0.55 and fades, and the «…» pill comes in instead.
The pill opens a menu under it with the hidden levels, indented a little more at each level, dropping 7 pixels one after the other. A click outside or Esc closes it, and the arrow keys move through it.
A single grey pill sits behind the row: on hover or focus it takes the crumb’s x and width on a spring, and it fades when the pointer leaves.
Going in, the rows leave to the left and come in from the right; going back, the other way round. The title rolls the same way.
| Name | File | Default | What it changes |
|---|---|---|---|
MAX_VISIBLE | script.js | 4 | How many levels the path shows before the middle ones fold into the «…» pill. |
SPRING | script.js | 1.6 | How far the crumbs overshoot when they open, fold and slide (0 = no bounce). |
SHIFT | script.js | 14 | How many pixels a new level travels in from the right. |
SPEED | script.js | 1 | The speed of every movement (2 = twice as fast). |
STEP | script.js | 1.5 | Seconds between one step and the next when the demo plays by itself. |
--accento | style.css | #3651d4 | The one accent colour: the current level’s icon, the focus ring, the menu and the rows under the pointer. |
At the top of the pages of a documentation site, a help centre, a drive or a dashboard with folders: wherever the path gets long and has to fit on a single line, phone included.
Everything is in em and the size follows the window’s width and height. On the phone the bar is narrow: the path folds as soon as it does not fit, leaving the first level, the dots and the last one. The search loses its label and the rows their second line. A tap does what a click does.
No movement or springs: the crumbs fade in and out with their width already in place, the title and the rows crossfade, the menu appears without dropping.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 8.7 KB; the libraries: GSAP 28 KB.
Tested on 25 November 2026
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.
You asked for
We made it for you: it’s in the library, with the preview, the Playground and the code to copy.
An animation you can’t find, or a site to take apart in the journal: tell us which. We pick the next ones from here.
With your account’s email and password.
or with your email
You’re signed in as .
With your account, you can download the zip of every animation and every pack, for free.