Skip to content

Product Carousel with Thumbnails

Bootstrap 6 product image carousel with a thumbnail rail, photo counter and arrows, next to a buy box with edition picker, quantity stepper and add to cart.

Also known as: product image gallery, product gallery with thumbnails, product detail page slider, ecommerce product images carousel

Product Carousel with Thumbnails live demo

Open in new tab

Bootstrap 6 code (HTML, CSS, JS)

A product detail block for Bootstrap 6: a square photo carousel with a thumbnail rail, a photo counter and round arrows, next to a buy box with price, edition picker, quantity stepper, wishlist toggle and an add-to-cart button. It fits online stores, product launch pages and marketplace listings.

How it works

.pct-gallery is the Bootstrap 6 .carousel. The main photo and its overlay sit in .pct-stage, which carries .carousel-overlay so the .carousel-overlay-controls (counter and arrows) are positioned over the photo, not over the thumbnails. Bootstrap 6 builds the slides on CSS scroll-snap, so swiping and trackpad scrolling work without extra code.

The thumbnail strip is a .carousel-indicators element with the extra class .pct-thumbs. Each .pct-thumb button has data-bs-slide-to, so Bootstrap moves .active and aria-current to the matching thumbnail for you; the CSS only restyles the indicator dots as image tiles. From 1024px the gallery becomes a CSS grid and the thumbnails form a vertical rail left of the photo.

The script imports Carousel, creates the instance with ends: 'wrap' and updates .pct-current on slid.bs.carousel. It also recalculates .pct-price-value from data-pct-base when an edition radio changes and clamps the .pct-qty-input stepper between its min and max. It swaps the heart icon when the data-bs-toggle="button" wishlist toggles aria-pressed, and simulates the add-to-cart request with a spinner and an "Added to cart" state.

Customization

  • --pct-accent on .pct-root: recolors the active thumbnail border, the badge, the edition picker and the Add to cart button. It also feeds --bs-primary-bg, so every theme-primary element follows.
  • --pct-thumb on .pct-root: makes the thumbnail tiles larger or smaller (4.5rem by default).
  • --pct-bg and --pct-line on .pct-root: change the page background and the divider above the perks list.
  • data-pct-base on .pct-price-value and each edition radio's value: set the base price and the surcharge.
  • max on .pct-qty-input: limits how many items can be added (9 here).
  • Change aspect-ratio on .pct-img to 4 / 5 for portrait product photos such as clothing.
  • Replace the setTimeout in the .pct-add click handler with a fetch() POST to your cart endpoint.

Use cases

  • Online stores: shoppers browse product photos with a thumbnail rail and pick an edition before adding to cart
  • Product launch pages: pair a square photo carousel with price, quantity stepper and a wishlist toggle
  • Marketplace listings: show several photos with a counter and arrows next to a compact buy box
  • Digital product shops: switch edition and see the price update while the gallery stays in view

Accessibility

The gallery is a labelled region with aria-roledescription="carousel" and labelled slides. .carousel-inner is focusable, so the Left and Right arrow keys move between photos. Thumbnails are real buttons with labels such as "Photo 2: front view" and aria-current on the active one. The quantity buttons and wishlist have aria-labels, the edition picker is a fieldset with a legend, and the add-to-cart result is announced through a polite role="status" region. Photos have descriptive alt text, and thumbnails use empty alt because their button already has a name.

Bootstrap 6 notes

Bootstrap 6 replaces .carousel-control-prev with buttons using .carousel-icon-prev, the toggle buttons now wrap their input inside label.btn-check, breadcrumbs use .breadcrumb-link and explicit .breadcrumb-divider items, and btn-primary becomes btn-solid theme-primary. This snippet targets 6.0.0-alpha.1, so APIs may still change. The product photos come from Unsplash; replace them with your own images. Icons come from Bootstrap Icons.

Product Carousel with Thumbnails at a glance

Framework
Bootstrap 6
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
Bootstrap 6, Bootstrap Icons
Layout
Responsive, works on mobile
Category
Carousels
License
Free for personal and commercial use

Questions about this template

Can I use the Product Carousel with Thumbnails 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 6 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@6.0.0-alpha.1/dist/css/bootstrap.min.css">
  • <script type="module" src="https://cdn.jsdelivr.net/npm/bootstrap@6.0.0-alpha.1/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">

Built for Bootstrap 6.0.0-alpha.1. Bootstrap 6 ships as an ES module, so its script and this component's JavaScript load with type="module". Alpha releases can still change before the stable version.

Product Carousel with Thumbnails – free Bootstrap 6 carousel template
Product Carousel with Thumbnails · free Bootstrap 6 carousel template

More Carousels

3D Coverflow Image Carousel – free Pure CSS carousel template

3D Coverflow Image Carousel

Coverflow-style image carousel with rotated 3D side photos, reflections, captions, dots, swipe and keyboard navigation in pure CSS and vanilla JS.

Scroll-Snap Carousel – free Pure CSS carousel template

Scroll-Snap Carousel

Native CSS scroll-snap carousel with arrow buttons, synced pill dots and keyboard support, enhanced by a few lines of vanilla JavaScript.

Infinite Auto-Scrolling Image Strip – free Pure CSS carousel template

Infinite Auto-Scrolling Image Strip

Seamless pure CSS marquee of landscape photos that loops forever, pauses on hover or focus and has a Pause/Play button.

Image Carousel with Thumbnails – free Tailwind CSS carousel template

Image Carousel with Thumbnails

Tailwind CSS image carousel with a clickable thumbnail strip, captions, swipe support, arrow-key navigation and optional looping.

Testimonial Carousel – free Bootstrap 6 carousel template

Testimonial Carousel

Bootstrap 6 testimonial carousel with crossfading customer quotes, avatars, star ratings, an autoplay progress indicator and a play/pause control.

Image Carousel with Captions – free Bootstrap 6 carousel template

Image Carousel with Captions

Dark Bootstrap 6 photo carousel with overlay captions, location badges, indicators, prev/next controls and a live slide counter, built on scroll-snap.