Skip to content

Customer Reviews with Photo Uploads

Bootstrap 5 review section with rating summary, customer photo gallery, lightbox, helpful votes and sorting.

Also known as: product reviews section, customer reviews with photos, review rating summary, reviews with lightbox, ecommerce reviews layout

Customer Reviews with Photo Uploads live demo

Open in new tab

Bootstrap 5 code (HTML, CSS, JS)

A Bootstrap 5 customer reviews section where buyers can show their own photos: a rating summary with distribution bars and a photo strip, a sortable list of reviews with photo thumbnails, helpful votes and a lightbox for the full-size images. Ideal for product pages of home decor, fashion or furniture shops.

How it works

The root section.rcp-reviews is split into two Bootstrap columns. The left .rcp-summary card shows the average score, the .rcp-bars distribution (Bootstrap progress bars sized with classes such as .rcp-w-78), the .rcp-gallery with every customer photo and a "Write a review" button. From the lg breakpoint the card is sticky. The right column holds the .rcp-toolbar with a sort select and the .rcp-list of article.rcp-review elements. From md up each review becomes a CSS grid with named areas, so the photos sit to the right of the text.

Every photo is a button.rcp-thumb with data-rcp-group, data-rcp-full (the large image URL) and data-rcp-author. On click the script collects all thumbnails of the same group, fills the .rcp-modal lightbox with the large image, caption and a counter, and opens it with bootstrap.Modal. The previous and next buttons and the arrow keys move through the group. The summary strip uses the group all, so it browses every photo.

Each .rcp-vote group has two .rcp-vote__btn buttons. Pressing one toggles aria-pressed, updates .rcp-vote__count and releases the opposite vote. Changing .rcp-sort reorders the reviews by helpful votes, data-rcp-date or data-rcp-rating.

Customization

  • --rcp-accent, --rcp-bg and --rcp-star on .rcp-reviews in style.css: change the terracotta accent, the section background and the star color.
  • --rcp-thumb on .rcp-reviews: make the review photo thumbnails larger or smaller.
  • --rcp-radius on .rcp-reviews: round or square the cards, thumbnails and lightbox.
  • data-rcp-date and data-rcp-rating on each .rcp-review: fill them from your data so the Newest and Highest rating sort options work.
  • data-rcp-group on .rcp-thumb: thumbnails with the same value are browsed together in the lightbox.
  • .rcp-w-78 and the other width classes: replace them with your real distribution, or set the width from your template.
  • The comment in the vote click handler in script.js: add a fetch() call there to store votes on your server.

Use cases

  • Product detail pages: a rating summary and customer photo gallery build buyer trust
  • Online stores: a lightbox lets shoppers view review photos at full size
  • Marketplaces: helpful votes help surface the most useful customer reviews for other shoppers
  • Review sections: sorting helps visitors find recent or top-rated opinions

Accessibility

The section is labelled by its heading and every review is an article labelled by its title. Star ratings are single role="img" elements with text such as "4 out of 5 stars", and the distribution bars have aria-label and aria-valuenow. The script gives every thumbnail an aria-label starting with "Enlarge photo" and aria-haspopup="dialog". The lightbox is a Bootstrap modal with focus trapping; its counter is a polite live region and focus returns to the thumbnail when it closes. Vote buttons use aria-pressed. Focus outlines are visible; hover zoom stops with prefers-reduced-motion.

Usage notes

Requires Bootstrap 5 and Bootstrap Icons. The photos come from Unsplash; replace them with your customers' uploads. Several sections can share a page; the script adds suffixes to the ids of every extra instance.

Customer Reviews with Photo Uploads 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
Reviews
License
Free for personal and commercial use

Questions about this template

Can I use the Customer Reviews with Photo Uploads 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">
Customer Reviews with Photo Uploads – free Bootstrap 5 review template
Customer Reviews with Photo Uploads · free Bootstrap 5 review template

More Reviews

Product Reviews – free Tailwind CSS review template

Product Reviews

Tailwind CSS product reviews section with a clickable rating breakdown filter, sorting and helpful vote buttons.