Skip to content
animorio
IT
All components

Package manager tabs

Tabs, Text, TransitionsGSAP, CSS onlyMediumCompressed weight: Demo 10 KBGSAP 28 KBFreeDownload the zip

The install panel of a library's docs, Lumen Motion, like a Dribbble shot: light porcelain with a grain, a one pixel edge and layered shadows. On top the npm, pnpm, yarn and bun tabs in a groove, with the white pill running on two springs, one per edge, stretching towards the new tab. Below, the command does not swap whole: only the letters that differ fall out and the new ones are typed one at a time, then the install line runs again with the turning arc, the check and the bar of seconds. Copy really copies and turns into Copied.

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>
<!--
  "Package manager tabs" 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 package manager tabs with the command that retypes itself</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/geist-mono@5.3.0/index.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="stage">
    <!-- the install panel of a docs page: the package manager tabs on top, with a pill that runs on two springs, the
         command below that erases only the letters that change and types the new ones, the install line that runs
         again, and the Copy button that really copies -->
    <section class="panel" data-panel aria-label="Install Lumen Motion">
      <i class="panel__light" aria-hidden="true"></i>
      <i class="panel__sheen" aria-hidden="true"></i>

      <header class="head">
        <div class="tabs" role="tablist" aria-label="Package manager" data-tabs>
          <span class="pill" data-pill aria-hidden="true"><i class="pill__glint" data-glint></i></span>
          <button class="tab" role="tab" type="button" id="tab-npm" data-tab="npm" aria-selected="true" aria-controls="code" tabindex="0">npm</button>
          <button class="tab" role="tab" type="button" id="tab-pnpm" data-tab="pnpm" aria-selected="false" aria-controls="code" tabindex="-1">pnpm</button>
          <button class="tab" role="tab" type="button" id="tab-yarn" data-tab="yarn" aria-selected="false" aria-controls="code" tabindex="-1">yarn</button>
          <button class="tab" role="tab" type="button" id="tab-bun" data-tab="bun" aria-selected="false" aria-controls="code" tabindex="-1">bun</button>
        </div>

        <button class="copy" type="button" data-copy aria-label="Copy command">
          <span class="copy__icon" aria-hidden="true">
            <svg viewBox="0 0 20 20" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
              <g data-sheets>
                <rect class="copy__back" x="6.5" y="2.75" width="10.75" height="10.75" rx="2.4" data-back></rect>
                <rect class="copy__front" x="2.75" y="6.5" width="10.75" height="10.75" rx="2.4" data-front></rect>
              </g>
              <path d="M4.2 10.6 8.1 14.3 15.9 5.9" pathLength="1" stroke-dasharray="1" stroke-dashoffset="1" stroke-width="1.8" data-tick></path>
            </svg>
          </span>
          <span class="copy__label" data-label>
            <span class="copy__word" data-word-a>Copy</span>
            <span class="copy__word copy__word--done" data-word-b aria-hidden="true">Copied</span>
          </span>
        </button>
      </header>

      <div class="well" id="code" role="tabpanel" aria-labelledby="tab-npm" data-well>
        <i class="well__sweep" data-sweep aria-hidden="true"></i>
        <div class="line line--cmd">
          <span class="prompt" aria-hidden="true">$</span>
          <span class="cmd" data-cmd><span class="sr" data-cmd-sr></span><span class="cmd__chars" data-chars aria-hidden="true"></span><i class="caret" data-caret aria-hidden="true"></i></span>
        </div>
        <div class="line line--out" data-out>
          <span class="out__mark" aria-hidden="true">
            <svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
              <path d="M3.4 8.4 6.6 11.4 12.7 4.8" pathLength="1" stroke-dasharray="1" stroke-dashoffset="1" data-out-tick></path>
            </svg>
            <svg class="out__spin" viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" data-out-spin>
              <path d="M8 2.5a5.5 5.5 0 1 1-5.5 5.5"></path>
            </svg>
          </span>
          <span class="out__text" data-out-text>1 package added</span>
          <span class="out__bar" aria-hidden="true"><i data-bar></i></span>
          <span class="out__time"><span data-time>0.0</span>s</span>
        </div>
      </div>

      <footer class="foot">
        <span class="foot__pkg">
          <svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linejoin="round" aria-hidden="true">
            <path d="M8 1.8 13.6 4.9v6.2L8 14.2 2.4 11.1V4.9Z"></path>
            <path d="M2.6 5 8 8l5.4-3M8 8v6"></path>
          </svg>
          <span data-pkg>@lumen/motion</span>
          <span class="foot__ver">2.4.1</span>
        </span>
        <span class="foot__meta">12.6 kB gzipped</span>
      </footer>
      <span class="sr" aria-live="polite" data-live></span>
    </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>

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.

32 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 “Package manager tabs” 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 white page a card of light porcelain rises, with a very fine grain, a one pixel edge catching the light on top and soft layered shadows. At the top, in a sunken groove, four tabs in a monospaced face: npm, pnpm, yarn and bun; over the chosen one a white pill with its own edge and shadow. On the right the Copy button with the two sheets icon. Below, in a slightly darker well, the command types itself letter by letter with a vermilion caret: npm install and the package name, @lumen/motion, in the accent colour. Then the install line: a thin arc turns, the green check draws itself, the bar fills on a spring and the seconds count up to that manager's time. Choosing another tab the pill runs on two springs: the leading edge is quicker, so it stretches towards the new tab and the other edge catches up, with a glint crossing it only while it runs. In the command the caret goes to where the differences start: only the letters that change fall out, tipping and closing their gap, and the new ones open their room and drop in with a one pixel bounce; the package name never moves. The install line runs again with the new manager's seconds: 1.9 for npm, 0.6 for pnpm, 1.2 for yarn, 0.2 for bun. Copy squashes under the finger, the two sheets fold into a check that draws itself, the word rolls to Copied, the letters of the command hop a little and a light passes over the code; after a moment Copy comes back. Left alone the card goes through every tab, copies and starts over; a touch hands it to whoever uses it.

How it works

A pill on two springs

The pill has no position and width but two edges, left and right, each with its own spring integrated in a requestAnimationFrame with four sub-steps (largest step 1/30 of a second). The edge heading to the new tab has its stiffness multiplied by STRETCH, the trailing one divided: the pill stretches and shortens by itself. When everything is still the loop stops.

Retype only what changes

The old and the new command are compared letter by letter from the start and from the end: the common prefix and suffix stay, the part in between is erased and retyped. From npm install to pnpm add only the package name stays; from yarn add to bun add the n and add stay too.

Letters that open and close their room

Each letter is an inline-block span. The one leaving takes its width in pixels, then GSAP brings it to zero while it tips and fades: the rest of the line slides instead of jumping. A new one starts at zero width and reaches its own with back.out, which gives it the one pixel bounce.

The caret following the letters

While the letters change width, a function on the GSAP ticker puts the caret back on the offsetLeft of the right letter every frame, only for the 450 milliseconds after the last change; at the end it glides to the end of the line and blinks again.

Copy turning into Copied

navigator.clipboard.writeText copies the real text of the command. The two rectangles of the icon shrink as they turn, the check draws itself by animating the stroke-dashoffset attribute on pathLength 1, the width of the label goes from Copy to Copied on the same spring and a gradient light crosses the well.

Values to change

NameFileDefaultWhat it changes
PACKAGEscript.js@lumen/motionThe package the command installs.
TYPINGscript.js24How many letters per second the command types.
ERASEscript.js40How many letters per second fall out while erasing.
STIFFNESSscript.js300The spring pulling the pill to its tab: higher is quicker.
DAMPINGscript.js24Lower lets the pill wobble more before it settles.
STRETCHscript.js1.9How much quicker the leading edge is: 1 does not stretch.
HOLDscript.js2.1How many seconds each tab stays when it runs by itself.
AUTOscript.jstrueGoes through the tabs and copies by itself until someone touches it.

Try them in the Playground

When to use it

For the docs of a library, an SDK, a component kit or a developer tool: the Install panel at the top of the guide, on the landing page of a developer product or in a site's README. The tabs let people pick their package manager and the command changes without losing sight of the package name.

On phones

The same animation with adapted sizes: the card is 92% of the screen wide, the tabs get narrower, the Copy button keeps only its icon (the check and the light over the code are still there) and the package size leaves the foot. The tabs are chosen with a finger.

With reduced motion

Nothing runs: the pill appears on the new tab with a fade, the new command appears whole with a fade, the bar and the seconds are already in place, and Copy turns into Copied with the check already drawn, with a fade.

Pitfalls

  • Erased letters as copies falling while the line jumped left at once made a tangle over the package name: now each letter closes its gap by animating its width, and the line slides.
  • The caret tweened to the right letter always arrived late, because the letter was moving meanwhile: while the letters change width the caret is put back every frame from the GSAP ticker, and only at the end it glides to the end with a tween.
  • The word Copied and the light over the code had a translate in the CSS: GSAP reads it as pixels and adds its yPercent, so the word stayed below and the light stopped inside the well. The starting positions are given with gsap.set and the CSS only keeps the opacity.
  • The install time in Geist Mono drew the zero with a slash: the seconds are in Mona Sans.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, Geist Mono (font variabile) 5.3.0.

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

Testing

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