
The slide-to-confirm button
Buttons, Physics, Transitions
The API reference sidebar of an invented payments company, Ledgerline, on white: the version, the search and four groups of endpoints with their GET, POST and DEL methods. A thin indigo marker on the rail and a light glass pill sit under the page you are on and travel on two springs: the front edge leaves at once and the back one follows, so the marker stretches over the rows it crosses and gathers on arrival. Opening a group folds the other one away and the marker rides the fold.
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>
<!--
"API docs sidebar" 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 API docs sidebar with the marker that slides between endpoints</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/jetbrains-mono@5.3.0/index.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<main class="stage" data-stage>
<!-- the sidebar of the API reference of a payments company (Ledgerline): four groups of endpoints, one open at a
time. A thin indigo marker on the rail and the soft pill behind the page you are on travel on two springs:
the edge in front leaves first, the one behind follows, so the marker stretches over the rows it crosses and
gathers again on arrival. Opening a group folds the other one away and the marker rides the fold -->
<nav class="docs" data-docs aria-label="API reference">
<header class="docs__head">
<span class="docs__brand">
<svg class="docs__mark" viewBox="0 0 24 24" aria-hidden="true">
<rect x="3" y="4" width="18" height="16" rx="5" />
<path d="M7.5 9.5h9M7.5 14.5h5.5" />
</svg>
<span class="docs__name">Ledgerline</span>
<span class="docs__kind">API</span>
</span>
<button class="docs__ver" type="button" aria-label="API version 2026-10">
<span>2026-10</span>
<svg viewBox="0 0 12 12" aria-hidden="true"><path d="M3.2 4.8 6 7.6l2.8-2.8" /></svg>
</button>
</header>
<button class="docs__search" type="button" aria-label="Search the API reference">
<svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="7" cy="7" r="4.4" /><path d="m10.4 10.4 3 3" /></svg>
<span class="docs__search-words">Search the API</span>
<kbd class="docs__key">/</kbd>
</button>
<div class="tree" data-tree>
<span class="tree__ghost" data-ghost aria-hidden="true"></span>
<span class="tree__pill" data-pill aria-hidden="true"><span class="tree__sheen" data-sheen></span></span>
<span class="tree__mark" data-mark aria-hidden="true"></span>
<section class="grp" data-group>
<button class="grp__head" type="button" aria-expanded="false" data-head>
<svg class="grp__chev" viewBox="0 0 12 12" aria-hidden="true" data-chev><path d="M4.6 3 7.6 6l-3 3" /></svg>
<span class="grp__name">Getting started</span>
<span class="grp__count">4</span>
</button>
<div class="grp__wrap" data-wrap>
<ul class="grp__list">
<li><a class="row" href="#overview" data-row><span class="row__face"><span class="row__words">Overview</span></span></a></li>
<li><a class="row" href="#authentication" data-row><span class="row__face"><span class="row__words">Authentication</span></span></a></li>
<li><a class="row" href="#errors" data-row><span class="row__face"><span class="row__words">Errors</span></span></a></li>
<li><a class="row" href="#idempotency" data-row><span class="row__face"><span class="row__words">Idempotent requests</span></span></a></li>
</ul>
</div>
</section>
<section class="grp" data-group data-open>
<button class="grp__head" type="button" aria-expanded="true" data-head>
<svg class="grp__chev" viewBox="0 0 12 12" aria-hidden="true" data-chev><path d="M4.6 3 7.6 6l-3 3" /></svg>
<span class="grp__name">Payments</span>
<span class="grp__count">5</span>
</button>
<div class="grp__wrap" data-wrap>
<ul class="grp__list">
<li><a class="row" href="#create-payment" data-row><span class="row__face"><span class="tag tag--post">POST</span><span class="row__words">Create a payment</span></span></a></li>
<li><a class="row" href="#retrieve-payment" data-row data-start><span class="row__face"><span class="tag tag--get">GET</span><span class="row__words">Retrieve a payment</span></span></a></li>
<li><a class="row" href="#list-payments" data-row><span class="row__face"><span class="tag tag--get">GET</span><span class="row__words">List all payments</span></span></a></li>
<li><a class="row" href="#capture-payment" data-row><span class="row__face"><span class="tag tag--post">POST</span><span class="row__words">Capture a payment</span></span></a></li>
<li><a class="row" href="#refund-payment" data-row><span class="row__face"><span class="tag tag--post">POST</span><span class="row__words">Refund a payment</span></span></a></li>
</ul>
</div>
</section>
<section class="grp" data-group>
<button class="grp__head" type="button" aria-expanded="false" data-head>
<svg class="grp__chev" viewBox="0 0 12 12" aria-hidden="true" data-chev><path d="M4.6 3 7.6 6l-3 3" /></svg>
<span class="grp__name">Customers</span>
<span class="grp__count">3</span>
</button>
<div class="grp__wrap" data-wrap>
<ul class="grp__list">
<li><a class="row" href="#create-customer" data-row><span class="row__face"><span class="tag tag--post">POST</span><span class="row__words">Create a customer</span></span></a></li>
<li><a class="row" href="#retrieve-customer" data-row><span class="row__face"><span class="tag tag--get">GET</span><span class="row__words">Retrieve a customer</span></span></a></li>
<li><a class="row" href="#delete-customer" data-row><span class="row__face"><span class="tag tag--del">DEL</span><span class="row__words">Delete a customer</span></span></a></li>
</ul>
</div>
</section>
<section class="grp" data-group>
<button class="grp__head" type="button" aria-expanded="false" data-head>
<svg class="grp__chev" viewBox="0 0 12 12" aria-hidden="true" data-chev><path d="M4.6 3 7.6 6l-3 3" /></svg>
<span class="grp__name">Webhooks</span>
<span class="grp__count">3</span>
</button>
<div class="grp__wrap" data-wrap>
<ul class="grp__list">
<li><a class="row" href="#create-endpoint" data-row><span class="row__face"><span class="tag tag--post">POST</span><span class="row__words">Create an endpoint</span></span></a></li>
<li><a class="row" href="#list-events" data-row><span class="row__face"><span class="tag tag--get">GET</span><span class="row__words">List events</span></span></a></li>
<li><a class="row" href="#delete-endpoint" data-row><span class="row__face"><span class="tag tag--del">DEL</span><span class="row__words">Delete an endpoint</span></span></a></li>
</ul>
</div>
</section>
</div>
</nav>
<!-- the pilot's pointer: shows the sidebar by itself and steps aside for a real hand -->
<svg class="hand" data-hand viewBox="0 0 24 24" aria-hidden="true">
<path d="M5 3.2 18.6 13l-6.1.9 3.6 6.6-2.6 1.4-3.6-6.7L5 19.4Z" />
</svg>
<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>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.
59 values to change
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 “API docs sidebar” from Animorio and fit it into my siteThe marker and the pill do not have one position but two numbers, the top edge and the bottom one, each on its own hand written spring (position, speed, stiffness, damping) integrated in steps of 1/120 of a second in a GSAP ticker. On each choice the edge in front of the trip gets the STIFF stiffness and the one behind STIFF times TRAIL: the first gets there sooner, the second chases it, and the marker stretches and gathers by itself.
The springs do not chase a fixed number but the row: every frame the script reads its distance from the top of the index by adding up the offsetTops to the index (the entrance's transforms do not count) and cuts it to what its group still shows. So if the group folds away the marker squashes and disappears into the fold instead of hanging in the air.
Each group is an overflow hidden wrap whose height goes from what it has to scrollHeight or to zero with GSAP. The one closing and the one opening use the same duration and the same curve, so the sum of the two heights never goes past the longest group and the index, as tall as that, never changes size. Once open, the height goes back to auto and follows resizes.
The ticker is on only while something moves (a choice, a fold, a resize) and takes itself off when both springs are still and no group is folding: at rest the page draws nothing.
The chosen row gets the is-current class: the words go to weight 590 and move two pixels on a curve that goes a hair past, the method tag fills with its colour and swells with back.out, and a white diagonal sheen crosses the pill. The grey ghost under the pointer moves with two quickTos, and follows it if the list moves.
| Name | File | Default | What it changes |
|---|---|---|---|
STIFF | script.js | 420 | The stiffness of the front edge: higher reaches the row sooner. |
TRAIL | script.js | 0.42 | The back edge as a share of the front one: lower stretches the marker more. |
DAMP | script.js | 0.8 | The damping of the springs: lower passes the row by more, 1 never passes it. |
FOLD | script.js | 0.5 | The seconds a group takes to fold open or shut. |
ONE_OPEN | script.js | true | Opening a group folds the open one away. |
FIRST_PAGE | script.js | true | Opening a group takes you to its first page. |
PACE | script.js | 1 | The pilot's pauses: higher waits longer between moves. |
LOOP | script.js | true | The pilot plays the tour again and again. |
For the docs site of an API, an SDK or a developer product, for an app's help centre or for any grouped sidebar (the settings of a dashboard, the chapters of a guide): it shows where you are and where you came from without a page change.
The same animation with adapted sizes: the card is 88% of the screen wide and the row height is sized on the window height too (between 22 and 33 pixels), so the whole sidebar fits the box. A finger taps groups and rows; the grey ghost, which is for the mouse only, does not appear.
Nothing slides: the marker and the pill appear at once on the chosen row, the groups open and close without a fold with their rows fading, and the pilot's arrow is not shown; the pilot still changes page and group.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, JetBrains Mono (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 8.4 KB; the libraries: GSAP 28 KB.
Tested on 7 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.
Support Animorio
Animorio stays free thanks to the people who support it. If you like, buy us a coffee: it helps us make the next animations.
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.