Skip to content

Mini Audio Player Bar

Bootstrap 5 fixed bottom audio player bar with cover art, play, skip, seekable progress, volume slider, mute and a clickable playlist.

Also known as: sticky audio player, bottom music player bar, podcast player bar, mini music player, fixed audio player

Bootstrap 5 Music Players Responsive Dark #audio #music #player #range #responsive

Mini Audio Player Bar live demo

Open in new tab

Bootstrap 5 code (HTML, CSS, JS)

A Bootstrap 5 mini audio player that stays fixed to the bottom of the screen, with cover art, play and skip buttons, a seekable progress bar, volume with mute and a favorite button. A demo playlist above it selects tracks. It fits podcasts, music blogs and band websites.

How it works

The wrapper .ap-root holds a demo playlist (ol.ap-tracks) and the bar itself (.ap-bar), which uses position: fixed at the bottom. The bar is a CSS Grid: on phones it shows the cover, title and the play and next buttons, and the progress bar becomes a thin line along the top edge. From 768px it switches to three columns: now playing (.ap-now), the controls with the timeline (.ap-center) and the volume group (.ap-volume).

Each li.ap-track stores its details in data-ap-title, data-ap-artist, data-ap-cover, data-ap-duration and data-ap-src. Its load() function copies the details into the bar, marks the track with is-current and aria-current, and resets the timeline. When data-ap-src contains a file URL, a real Audio object plays it and the timeupdate, loadedmetadata and ended events drive the progress. When it is empty, as in this demo, a 250 ms interval simulates playback for testing without media files.

One delegated click listener handles the data-ap-action buttons (toggle, prev, next). Previous restarts the song after 3 seconds. The .ap-seek and .ap-vol range inputs listen for input, and a setFill() helper writes --ap-fill so the gradient follows the thumb. The play button toggles is-playing on the root, which animates the small .ap-eq bars of the current track.

Customization

  • data-ap-src on each li.ap-track: add the MP3 or AAC URL to play real audio instead of the simulated clock.
  • data-ap-start on .ap-bar: the start position in seconds for the first track (72 shows a partly played song).
  • --ap-accent and --ap-accent-2 on .ap-root in style.css: change the gradient of both sliders, the active track and the equalizer.
  • --ap-bar-bg on .ap-root: change the bar background or its transparency.
  • --ap-bar-height on .ap-root: bottom padding that keeps page content clear of the bar.
  • value="70" on .ap-vol: set the starting volume in percent.
  • Remove the .ap-page section to use only the bar on your own pages.

Use cases

  • Podcast sites: a fixed bottom bar keeps playback controls in reach while visitors browse
  • Music blogs: a clickable playlist loads each track's cover, title and artist
  • Band websites: play, skip, seek and volume controls with a mute button and a favorite button
  • Demos without audio files: simulated playback lets you test the layout before adding MP3 URLs
  • Mobile pages: the bar shrinks to cover, title and play button with a thin progress line

Accessibility

The bar is a role="region" with an aria-label. All icon buttons have labels; the play button switches its aria-label between "Play" and "Pause", and the mute and favorite buttons use aria-pressed. The sliders are native range inputs, so arrow keys work, and they expose readable values through aria-valuetext, such as "1:12 of 3:45". Playlist rows are real buttons with a visually hidden "Play" prefix. Every control has a :focus-visible outline, and the equalizer animation is turned off under prefers-reduced-motion.

Usage notes

Requires Bootstrap 5 (loaded automatically) and Bootstrap Icons. The cover photos come from Unsplash; replace them with your own artwork. Browsers only start audio after a user gesture, which this player respects because playback always begins from a click.

Mini Audio Player Bar at a glance

Framework
Bootstrap 5
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
Bootstrap 5, Bootstrap Icons
Layout
Responsive, works on mobile, dark design
Category
Music Players
License
Free for personal and commercial use

Questions about this template

Can I use the Mini Audio Player Bar code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

Load Bootstrap 5 and Bootstrap Icons from a CDN (the links are under Requirements). Paste the HTML where the component should appear, add the CSS to your stylesheet and load the JavaScript before the closing </body> tag. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. The script is plain vanilla JavaScript, so it works without jQuery, React or Vue. You can still use the markup inside those frameworks.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

Add these to your page (already included in the download):

  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
  • <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
Mini Audio Player Bar – Bootstrap 5 music players component screenshot
Mini Audio Player Bar · Bootstrap 5 Music Players

More Music Players

Music Player Card – Pure CSS music players preview

Music Player Card

Dark music player card with a spinning vinyl cover, seek bar, play, skip, shuffle and repeat controls, volume slider and a clickable playlist.