Skip to content

Bootstrap Product Page

Bootstrap 5 product details page with image gallery, color and size pickers, quantity stepper, and tabs for description, specifications and customer reviews.

Also known as: product detail page, ecommerce product page, single product page, product page with gallery

Bootstrap Product Page live demo

Open in new tab

Bootstrap 5 code (HTML, CSS, JS)

A complete Bootstrap 5 product details page for online stores: an image gallery with thumbnails, price with discount, color and size pickers, a quantity stepper and add-to-bag button, followed by Bootstrap tabs for the description, specifications and customer reviews.

How it works

The root .pp-product starts with a breadcrumb and a two-column row. The left column holds .pp-gallery: a large .pp-stage__img and four .pp-thumb buttons. The right column, .pp-info, contains the brand, title, star rating, .pp-price, a short lead and the .pp-form. Colors and sizes are radio inputs with Bootstrap's btn-check class, styled through the .pp-color and .pp-size labels; a disabled size gets a striped, crossed-out look. Below the columns, .pp-tabs is a Bootstrap nav with role="tablist" and .pp-panels holds three fading tab panes, including a navy .pp-score box with rating bars and .pp-review cards.

The script handles each .pp-product separately. Thumbnails swap the main image using data-pp-src and data-pp-alt, and color radios do the same while updating .pp-color-name. The quantity buttons with data-pp-step change .pp-qty__input within its min and max. On submit, a missing size adds .pp-is-invalid, writes a message into .pp-error and focuses the first available size; otherwise .pp-status confirms the selection. Links that point to a tab pane, such as "Read 128 reviews", open that tab with bootstrap.Tab.

Customization

  • --pp-navy and --pp-gold on .pp-product in style.css: change the main dark color and the accent used for the button, stars and active tab.
  • data-pp-src on each .pp-thumb and color radio: point to your own product photos.
  • .pp-color--midnight, .pp-color--ember and .pp-color--glacier: set the swatch colors for your variants.
  • min="1" max="5" on .pp-qty__input: change the allowed quantity range.
  • disabled on a size radio: marks that size as sold out with the striped style.
  • .pp-bar--72 and the other width classes: update the rating bar lengths together with aria-valuenow.
  • The status text in the submit handler in script.js: replace it with a fetch() call to your cart endpoint.

Use cases

  • Online stores: the product page with gallery, color and size pickers and an add-to-bag button
  • Fashion and apparel shops: size and color selection with a quantity stepper
  • Product specs and reviews: tabs for description, specifications and customer reviews

Accessibility

Tabs use Bootstrap's ARIA pattern with aria-selected, aria-controls and arrow key support, and each pane is focusable. Color and size choices are native radios grouped in fieldsets with legends, and sold-out sizes include hidden "(sold out)" text. Thumbnails and the wishlist button use aria-pressed. .pp-error and .pp-status are live regions, star ratings are role="img" with labels and the progress bars have aria-label values. Visible gold focus outlines are applied to all controls, and fades are disabled under prefers-reduced-motion.

Usage notes

Requires Bootstrap 5 with its JS bundle (added automatically) and Bootstrap Icons. The component uses one h1, so place it as the main content of a product page.

Bootstrap Product Page 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
Category
Product Details
License
Free for personal and commercial use

Questions about this template

Can I use the Bootstrap Product Page 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">
Bootstrap Product Page – free Bootstrap 5 product detail page template
Bootstrap Product Page · free Bootstrap 5 product detail page template

More Product Details

Product Detail with Gallery – free Tailwind CSS product detail page template

Product Detail with Gallery

Dark Tailwind CSS product page section with a thumbnail image gallery, finish options, quantity stepper and add to cart button with loading state.

Frequently Bought Together Section for Shopify – free Shopify product detail page template

Frequently Bought Together Section for Shopify

Shopify section that shows the current product with up to 3 picked products, checkboxes, variant selects, a live total and one button that adds everything checked to the cart.

Sticky Add to Cart Bar for Shopify – free Shopify product detail page template

Sticky Add to Cart Bar for Shopify

Shopify section: a bar fixed to the bottom of product pages that appears once the main add-to-cart button scrolls away, with image, price, variant select and a real product form.

Product Detail with Image Zoom Lens – free Tailwind CSS product detail page template

Product Detail with Image Zoom Lens

Tailwind CSS product detail section with a round magnifier lens that zooms the photo on hover or arrow keys, plus adjustable 2x to 4x levels.