Skip to content
animorio
IT
All components

Pull-up bag tab bar

Navigation, Hover, TransitionsGSAP, CSS onlyMediumCompressed weight: Demo 10 KBGSAP 28 KBFreeDownload the zip

The tab bar of the Moll & Rye app, a made-up homeware shop, alone on white in the premium product style. The tabs are chosen with a pill that slides on a spring; above the Bag tab sits a small grip: pull it up with your finger and the bar itself stretches into the bag sheet, following the finger, with the three items arriving one after the other, the free shipping line filling and the Checkout button. Let go past a third and it opens with a one pixel overshoot, before that it slides back; on Checkout a light runs across, the tick draws, the sheet folds back into the bar and the bag number rolls to zero.

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>
<!--
  "Pull-up bag tab bar" 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 shop tab bar with the bag you pull up into checkout</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 tab bar of a made-up homeware shop app: the Bag tab has a little grip on top; pull it up (or tap it)
         and the bar stretches into the bag sheet with the items, the free shipping line and the checkout button -->
    <div class="dock" data-dock>
      <section class="shop" data-shop aria-label="Moll &amp; Rye">
        <span class="shop__sheen" aria-hidden="true"></span>

        <div class="sheet" data-sheet id="bag-sheet" role="region" aria-label="Your bag">
          <div class="sheet__inner" data-inner>
            <div class="sheet__grab" data-grabzone aria-hidden="true"><span></span></div>

            <header class="bag-head" data-head>
              <span class="bag-head__txt">
                <span class="bag-head__title">Your bag</span>
                <span class="bag-head__sub"><span data-count-sub>3 items</span> · <span data-brand>Moll &amp; Rye</span></span>
              </span>
              <button class="shut" type="button" data-shut aria-label="Close the bag">
                <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4.5 4.5l7 7M11.5 4.5l-7 7" /></svg>
              </button>
            </header>

            <ul class="items" data-items>
              <li class="item" data-item>
                <span class="tile tile--linen" aria-hidden="true">
                  <svg viewBox="0 0 32 32"><path d="M7 11.5c0-1.4 1.1-2.5 2.5-2.5h13c1.4 0 2.5 1.1 2.5 2.5v9c0 1.4-1.1 2.5-2.5 2.5h-13A2.5 2.5 0 0 1 7 20.5Z" /><path d="M7 16h18M7 19.5h18" /></svg>
                </span>
                <span class="item__txt"><span class="item__name">Washed linen throw</span><span class="item__var">Oat · 130 x 170</span></span>
                <span class="item__price">$84.00</span>
              </li>
              <li class="item" data-item>
                <span class="tile tile--glaze" aria-hidden="true">
                  <svg viewBox="0 0 32 32"><path d="M9 10h12v10.5a3.5 3.5 0 0 1-3.5 3.5h-5A3.5 3.5 0 0 1 9 20.5Z" /><path d="M21 13h1.6a2.6 2.6 0 0 1 0 5.2H21" /></svg>
                </span>
                <span class="item__txt"><span class="item__name">Stoneware mugs, pair</span><span class="item__var">Sea glaze · 2 x 330 ml</span></span>
                <span class="item__price">$46.00</span>
              </li>
              <li class="item" data-item>
                <span class="tile tile--wax" aria-hidden="true">
                  <svg viewBox="0 0 32 32"><path d="M12 12.5h3v12h-3ZM17 10.5h3v14h-3Z" /><path d="M13.5 12.5v-2M18.5 10.5v-2" /></svg>
                </span>
                <span class="item__txt"><span class="item__name">Beeswax tapers</span><span class="item__var">Honey · set of 4</span></span>
                <span class="item__price">$28.00</span>
              </li>
            </ul>

            <div class="ship" data-ship>
              <span class="ship__row">
                <span class="ship__label">
                  <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M1.8 4.5h7.4v6.3H1.8ZM9.2 6.6h2.6l2.4 2.3v1.9H9.2" /><circle cx="4.4" cy="11.6" r="1.3" /><circle cx="11.6" cy="11.6" r="1.3" /></svg>
                  Free shipping unlocked
                </span>
                <span class="ship__note">over $150</span>
              </span>
              <span class="ship__track"><span class="ship__fill" data-shipfill></span></span>
            </div>

            <button class="pay" type="button" data-pay>
              <span class="pay__sweep" data-sweep aria-hidden="true"></span>
              <span class="pay__face" data-payface>
                <span class="pay__label" data-paylabel>Checkout</span>
                <span class="pay__total" data-paytotal>$158.00</span>
              </span>
              <span class="pay__done" data-paydone aria-hidden="true">
                <svg viewBox="0 0 18 18"><path data-tick d="M4.5 9.4l3 2.9 6-6.4" /></svg>
                <span>Order placed</span>
              </span>
            </button>
          </div>
        </div>

        <nav class="tabs" data-tabs aria-label="Shop">
          <span class="tabs__hover" data-hoverpill aria-hidden="true"></span>
          <span class="tabs__pill" data-pill aria-hidden="true"><span class="tabs__pillface"></span></span>
          <span class="grip" data-grip aria-hidden="true"><span></span></span>

          <button class="tab is-active" type="button" data-tab="home" aria-current="page">
            <span class="tab__icon" data-icon>
              <svg viewBox="0 0 24 24" aria-hidden="true"><path class="fillable" d="M4.5 10.4 12 4.6l7.5 5.8v8.1a1.6 1.6 0 0 1-1.6 1.6h-3.6v-5.4h-4.6v5.4H6.1a1.6 1.6 0 0 1-1.6-1.6Z" /></svg>
            </span>
            <span class="tab__label">Home</span>
          </button>
          <button class="tab" type="button" data-tab="search">
            <span class="tab__icon" data-icon>
              <svg viewBox="0 0 24 24" aria-hidden="true"><circle class="fillable" cx="10.8" cy="10.8" r="5.8" /><path d="m15.2 15.2 4.3 4.3" /></svg>
            </span>
            <span class="tab__label">Search</span>
          </button>
          <button class="tab" type="button" data-tab="saved">
            <span class="tab__icon" data-icon>
              <svg viewBox="0 0 24 24" aria-hidden="true"><path class="fillable" d="M7 4.8h10a1.2 1.2 0 0 1 1.2 1.2v13.6L12 15.9l-6.2 3.7V6A1.2 1.2 0 0 1 7 4.8Z" /></svg>
            </span>
            <span class="tab__label">Saved</span>
          </button>
          <button class="tab tab--bag" type="button" data-tab="bag" data-bag aria-expanded="false" aria-controls="bag-sheet">
            <span class="tab__icon" data-icon>
              <svg viewBox="0 0 24 24" aria-hidden="true"><path class="fillable" d="M5.6 8.4h12.8l-.9 10.4a1.6 1.6 0 0 1-1.6 1.4H8.1a1.6 1.6 0 0 1-1.6-1.4Z" /><path d="M9 10.6V7.4a3 3 0 0 1 6 0v3.2" /></svg>
              <span class="badge" data-badge><span class="badge__roll" data-badgeroll><span class="badge__n">3</span></span></span>
            </span>
            <span class="tab__label">Bag</span>
          </button>
          <button class="tab" type="button" data-tab="account">
            <span class="tab__icon" data-icon>
              <svg viewBox="0 0 24 24" aria-hidden="true"><circle class="fillable" cx="12" cy="8.6" r="3.6" /><path class="fillable" d="M5.2 19.6c.6-3.4 3.4-5.6 6.8-5.6s6.2 2.2 6.8 5.6Z" /></svg>
            </span>
            <span class="tab__label">Account</span>
          </button>
        </nav>
      </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.

42 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 “Pull-up bag tab bar” 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 ground there is only the bottom bar of a shopping app, in warm paper with a one pixel edge and a soft two layer shadow: Home, Search, Saved, Bag and Account, with line icons. The chosen tab fills, its label widens a little and it sits on a light pill; hovering with the mouse, a ghost pill follows the pointer and the icon lifts by a pixel and a half. Choosing another tab, the pill runs there on a spring, squashes for a moment and settles, and the new icon does a little bounce. Above Bag, next to the terracotta item count, a thin grip lifts by three pixels now and then to say it can be pulled. Pulling it up, the bar itself stretches upwards following the finger: the Your bag header appears, then the three items (the linen throw, the stoneware mugs, the beeswax candles) one after the other, the free shipping line filling and the dark Checkout button with the total; the other tabs dim, the shadow deepens. Let go past a third and the sheet opens with a one pixel overshoot, before that it slides back; pulled past the top, it gives a little like an elastic. Pressing Checkout, a light runs across it twice, the Order placed tick draws, the sheet folds back into the bar with a small settle and the bag number rolls to zero. Left alone, a drawn pointer does the whole round.

How it works

One surface

The bar and the sheet are the same box, anchored at the bottom: the script only changes its height, from 68 pixels to 68 plus the sheet height measured on resize. The sheet content hangs from the top, inside a box with hidden overflow that ends above the bar, so the header comes first and the items are uncovered below it.

The drag

On pointerdown on the Bag tab (or on the head of the open sheet) the script captures the pointer and turns the vertical movement into a fraction p from 0 to 1; above 1 it gives 22%, below 0 almost nothing. The speed is kept as a moving average and, on release, p plus the speed times 0.12 decides whether the sheet opens or slides back.

Things that arrive with the finger

Each part of the sheet has its own window of p: the header up to 0.3, the items staggered by 0.12 each, the shipping line and the button at the end. The surface shadow is a box-shadow with calc on a --lift variable, written on every frame.

The pill

The pill under the chosen tab moves with x and width on an elastic, and starts from scaleY 0.92 at the same time: it squashes for a moment as it runs. Past half way the chosen tab becomes Bag; when the sheet closes, the previous one comes back.

The checkout

One timeline: the label dims, a band of light crosses the button twice, the tick draws from its stroke with a small elastic, then the sheet closes and the bag number rolls up to zero and shrinks away.

Values to change

NameFileDefaultWhat it changes
BRANDscript.js"Moll & Rye"The name of the shop.
ITEMSscript.js3How many items the badge on the bag counts.
TOTALscript.js"$158.00"The total on the Checkout button.
OPEN_ATscript.js0.33How far you must pull (0 to 1) for the sheet to stay open when you let go.
RUBBERscript.js0.22How much the sheet gives when pulled past the top (0 stops dead).
SPRINGscript.js1How lively the springs are (0 none, 1.6 a lot).
HINTscript.jstrueThe grip above Bag lifts now and then to say it can be pulled.
LOOPscript.jstrueLeft alone, the drawn pointer does the round again.

Try them in the Playground

When to use it

In the app or mobile site of an online store, a bookshop, a wine shop or a delivery service: anywhere the bag must always be within thumb’s reach and checkout one gesture away from the page you are looking at.

On phones

The bar narrows to the full width minus 28 pixels and the sheet heights use clamp with vh, so it fits the phone box when open; on the phone you pull with a real finger (touch-action none on the Bag tab), and a tap without dragging opens and closes like a click.

With reduced motion

No springs and no movement: the sheet opens and closes with a fade, the pill jumps to the chosen tab, the light on the button does not run and the tick appears already drawn. The drawn pointer is not shown, the demo still repeats.

Pitfalls

  • The shadow goes on the outer box and the hidden overflow only on the sheet inside: with overflow hidden on the surface itself the layered shadow was cut.
  • The outer box is as tall as the open sheet, measured on resize: so the closed bar already sits where the open sheet will end and opening moves nothing around it, nor leaves the phone box.
  • Without setPointerCapture the finger going up past the bar leaves the Bag tab and the drag is lost half way; and without touch-action none the phone takes it for a page scroll.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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