Skip to content
animorio
IT
All components

Music app bottom bar

Navigation, Hover, PhysicsGSAP, CSS onlyMediumCompressed weight: Demo 6.8 KBGSAP 28 KBFreeDownload the zip

The bottom navigation bar, the tab bar, of a music app, on black: the marker of the chosen tab is the cover of the song playing, a small rounded square that slides from tab to tab on a spring and tilts a little on the way, while the icon over it fills from the bottom. On the top edge the thin progress line of the song runs and, when it reaches the end, the next cover slides in from the side.

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>
<!--
  "Music app bottom 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 music app tab bar with the sliding album cover</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" data-stage>
    <!-- the bottom tab bar of a music app. The marker of the chosen tab is the cover of the song playing, a small
         rounded square that slides from tab to tab on a spring and tilts a little on the way; the icon over it fills
         in. On the top edge of the bar, the thin line of the song's progress -->
    <nav class="bar" aria-label="Main" data-bar>
      <span class="bar__edge" aria-hidden="true"></span>
      <span class="prog" aria-hidden="true"><span class="prog__fill" data-fill></span></span>

      <span class="cover" data-cover aria-hidden="true">
        <span class="cover__glow" data-glow></span>
        <span class="cover__tilt" data-tilt>
          <span class="cover__art" data-art></span>
          <span class="cover__sheen" data-sheen></span>
        </span>
      </span>

      <button class="tab" type="button" data-tab aria-current="page">
        <svg class="tab__icon" viewBox="0 0 24 24" aria-hidden="true">
          <defs><clipPath id="fill-home"><rect data-clip x="-2" y="-2" width="28" height="28"/></clipPath></defs>
          <path class="tab__line" d="M4.2 10.4 12 4.1l7.8 6.3v8.4a1.7 1.7 0 0 1-1.7 1.7h-3.4v-5.6H9.3v5.6H5.9a1.7 1.7 0 0 1-1.7-1.7z"/>
          <path class="tab__fill" clip-path="url(#fill-home)" d="M4.2 10.4 12 4.1l7.8 6.3v8.4a1.7 1.7 0 0 1-1.7 1.7h-3.4v-5.6H9.3v5.6H5.9a1.7 1.7 0 0 1-1.7-1.7z"/>
        </svg>
        <span class="tab__label">Home</span>
      </button>
      <button class="tab" type="button" data-tab>
        <svg class="tab__icon" viewBox="0 0 24 24" aria-hidden="true">
          <defs><clipPath id="fill-search"><rect data-clip x="-2" y="-2" width="28" height="28"/></clipPath></defs>
          <circle class="tab__line" cx="10.6" cy="10.6" r="6.4"/>
          <path class="tab__line" d="m15.4 15.4 4.6 4.6"/>
          <circle class="tab__fill tab__fill--lens" clip-path="url(#fill-search)" cx="10.6" cy="10.6" r="6.4"/>
          <path class="tab__fill tab__fill--stroke" clip-path="url(#fill-search)" d="m15.4 15.4 4.6 4.6"/>
        </svg>
        <span class="tab__label">Search</span>
      </button>
      <button class="tab" type="button" data-tab>
        <svg class="tab__icon" viewBox="0 0 24 24" aria-hidden="true">
          <defs><clipPath id="fill-pods"><rect data-clip x="-2" y="-2" width="28" height="28"/></clipPath></defs>
          <rect class="tab__line" x="8.8" y="3.4" width="6.4" height="10.8" rx="3.2"/>
          <path class="tab__line" d="M5.8 11.2a6.2 6.2 0 0 0 12.4 0M12 17.4v3.2M9.2 20.6h5.6"/>
          <rect class="tab__fill" clip-path="url(#fill-pods)" x="8.8" y="3.4" width="6.4" height="10.8" rx="3.2"/>
          <path class="tab__fill tab__fill--stroke" clip-path="url(#fill-pods)" d="M5.8 11.2a6.2 6.2 0 0 0 12.4 0M12 17.4v3.2M9.2 20.6h5.6"/>
        </svg>
        <span class="tab__label">Podcasts</span>
      </button>
      <button class="tab" type="button" data-tab>
        <svg class="tab__icon" viewBox="0 0 24 24" aria-hidden="true">
          <defs><clipPath id="fill-lib"><rect data-clip x="-2" y="-2" width="28" height="28"/></clipPath></defs>
          <rect class="tab__line" x="4" y="4.2" width="3.6" height="15.6" rx="1.1"/>
          <rect class="tab__line" x="10" y="4.2" width="3.6" height="15.6" rx="1.1"/>
          <rect class="tab__line" x="15.6" y="5.2" width="3.6" height="15" rx="1.1" transform="rotate(-14 17.4 12.7)"/>
          <rect class="tab__fill" clip-path="url(#fill-lib)" x="4" y="4.2" width="3.6" height="15.6" rx="1.1"/>
          <rect class="tab__fill" clip-path="url(#fill-lib)" x="10" y="4.2" width="3.6" height="15.6" rx="1.1"/>
          <rect class="tab__fill" clip-path="url(#fill-lib)" x="15.6" y="5.2" width="3.6" height="15" rx="1.1" transform="rotate(-14 17.4 12.7)"/>
        </svg>
        <span class="tab__label">Library</span>
      </button>
    </nav>

    <p class="sr" aria-live="polite" data-live></p>
    <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"/></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.

19 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 “Music app bottom 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

A 72 pixel graphite bar with rounded corners, a thread of light on top and three shadows under it, with four tabs: Home, Search, Podcasts and Library, drawn as line icons. Behind the icon of the chosen tab sits the cover of the song playing, a 38 pixel square with rounded corners, a glossy sheen and a glow of its colour falling on the bar. Choosing another tab, the cover slides over to it on a spring: on the way it lifts a couple of pixels, tilts with the run, the sheen slides across it and the glow trails a little behind; once there it goes a touch past and settles. Meanwhile the icon left behind empties and the new one fills with white from the bottom with a small bounce, and its label gains weight. On the top edge the progress line, in the cover’s colour, runs; when it reaches the end the next song slides into the square from the side, the square squeezes and comes back, and the line starts again in the new colour. Pressing the chosen tab again makes the cover hop.

How it works

A spring written by hand

The cover’s position is a damped spring worked out on every frame with the GSAP ticker: acceleration equals stiffness times distance minus damping times speed, with the time step capped at 1/30 of a second. Damped under critical, it goes a few pixels past and comes back. When it rests the loop is detached.

The tilt comes from the speed

The spring’s own speed gives the tilt (speed times TILT, ten degrees at most), the lift and a scale of a few hundredths; the glow behind moves the other way and seems to trail behind. So the cover only tilts while it runs and straightens by itself when it arrives.

Icons that fill

Every icon is drawn twice: the line outline and the solid white shape, cut by a clipPath with a rectangle. GSAP raises the rectangle from the bottom through its y attribute, delayed just enough for the cover to have nearly arrived; the one left behind empties the other way.

The song that changes

The progress line is a scaleX of the time played. At the end, the new cover (CSS gradients only: a sunset, a moon, a flower of rings) comes in with xPercent over the old one, the square squeezes on an elastic spring and the --accent variable moves to the new colour.

Sizes and pilot

The cover’s targets are read from the buttons’ positions and read again with a ResizeObserver. The tabs are buttons with aria-current, the arrow keys change tab and an aria-live region says the tab and the song. A drawn pointer taps the tabs in turn; at the first real touch it stops and starts again after six seconds.

Values to change

NameFileDefaultWhat it changes
STIFFscript.js260How stiff the spring carrying the cover is.
DAMPscript.js21How much the spring is held back: lower, and the cover goes further past and back.
TILTscript.js0.013How much the cover tilts with its speed (0 stays straight).
SONGscript.js8Seconds of each song before the next cover comes in.
FILLscript.js0.45Seconds for the chosen tab’s icon to fill.
COVERscript.js38Side of the cover in pixels.
STARTscript.js0The tab chosen when the page opens (0 is the first).

Try them in the Playground

When to use it

In the bottom bar of a music, podcast or radio app, where the song playing stays in sight without an extra mini player. With another picture in the square (a profile photo, a book cover, the latest order) it suits any app that wants something alive inside its navigation.

On phones

The same animation: the bar is at most the screen width minus 32 pixels, and the cover’s targets are worked out again when the width changes. A tap chooses the tab and makes it sink for a moment.

With reduced motion

Nothing moves: the cover fades out of the tab left and fades in on the chosen one, without tilting; the icons fill quickly, the new song arrives with a fade and the pilot’s pointer is hidden.

Pitfalls

  • The white icon over the light orange cover was hard to read: every cover has a soft dark veil in the middle, which does not show as a stain but keeps the icon readable.
  • With the tilt on the same element GSAP moves, the two transforms wiped each other out: the move is on the cover, the tilt and the lift on its child.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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