Skip to content

Product Quick View Modal with Photo

Bootstrap 5 product quick view modal with photo, rating, material and size options that update price and image, quantity stepper and add to cart.

Also known as: quick view popup, product quick look modal, quick shop modal, product preview popup, quick add to cart modal

Product Quick View Modal with Photo live demo

Open in new tab

Bootstrap 5 code (HTML, CSS, JS)

A Bootstrap 5 product quick view modal with a large product photo, rating, live price, material and size options, a quantity stepper and an add-to-cart button. Use it on category pages and product grids so shoppers can check details and add an item without leaving the list.

How it works

The root section.qv-root holds a product tile (.qv-tile) and the modal (.modal.qv-modal). The tile's .qv-tile__btn opens the modal through Bootstrap's data-bs-toggle="modal". Inside, a row g-0 splits the dialog into the photo column (.qv-media with .qv-photo and a .qv-badge) and the form.qv-form with the details. The dialog uses modal-lg modal-dialog-centered on desktop and modal-fullscreen-sm-down on phones, where the photo stacks above the form.

Material and size choices are radio inputs with Bootstrap's btn-check pattern, styled as pills by .qv-swatch and .qv-size. Each material radio carries data-qv-price, data-qv-img and data-qv-alt. On change the script formats the price with Intl.NumberFormat, writes it to .qv-price__value, updates .qv-material-name and swaps the photo, fading it with the is-loading class until the new image loads. Buttons with data-qv-step change the quantity, and a clamp() helper keeps it inside the input's min and max.

Submitting the form calls preventDefault(), shows "Adding..." for 600 ms, then turns .qv-add green with is-added and writes a summary into .qv-status. The hidden.bs.modal event clears the message. The data-qv-open="true" flag opens the modal on page load for the demo.

Customization

  • --qv-accent and --qv-ink on .qv-root in style.css: change the add-to-cart color, eyebrow text and the selected pill color.
  • data-qv-price and data-qv-img on each material radio: set the price and photo shown for that option; add more radios for more variants.
  • disabled on a size radio: marks the size as sold out with a strike-through pill, as on the 30 L option.
  • min="1" max="5" on the quantity input: change the allowed quantity range.
  • The setTimeout block in the submit handler of script.js: replace it with a fetch() call to your cart API.
  • Remove data-qv-open="true" from .qv-root so the modal only opens from the Quick view button.
  • max-width: 280px in .qv-tile: resize the product tile to fit your grid.

Use cases

  • Category pages: shoppers check details of an item without leaving the product list
  • Product grids: open a modal with photo, rating, material and size options from a Quick view button
  • Online stores: the price and photo update when a material is chosen
  • Mobile shops: the dialog goes fullscreen on phones with the photo stacked above the form
  • Conversion-focused shops: a quantity stepper and add-to-cart button let customers buy right away

Accessibility

The modal uses Bootstrap's focus trap, Escape to close and aria-labelledby pointing at the product title. The close button has an aria-label. Options are real radio groups inside fieldset elements with a legend, so arrow keys work and screen readers announce the group. The sold-out size includes visually hidden "(sold out)" text. The star row is one role="img" element with a rating label. Price changes and the cart message are announced through aria-live regions. Every control has a visible :focus-visible outline, and the photo fade is disabled under prefers-reduced-motion.

Usage notes

Requires Bootstrap 5 (loaded automatically) and Bootstrap Icons. The photos come from Unsplash; replace them with your own product images. For several products on one page, give each modal, title and radio group unique id and name values.

Product Quick View Modal with Photo 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
Modals
License
Free for personal and commercial use

Questions about this template

Can I use the Product Quick View Modal with Photo 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">
Product Quick View Modal with Photo – Bootstrap 5 modals component screenshot
Product Quick View Modal with Photo · Bootstrap 5 Modals

More Modals

Multi-Step Wizard Dialog – Bootstrap 6 modals preview

Multi-Step Wizard Dialog

Bootstrap 6 Dialog wizard with three steps, a Stepper and progress bar, back/next buttons, per-step validation, Chips email invites and a review screen.

Image Lightbox Dialog – Bootstrap 6 modals preview

Image Lightbox Dialog

Dark Bootstrap 6 Dialog lightbox that opens gallery thumbnails large, with previous/next buttons, arrow-key and swipe navigation, captions and a photo counter.

Newsletter Popup Dialog – Bootstrap 6 modals preview

Newsletter Popup Dialog

Bootstrap 6 Dialog newsletter popup with a photo side, email signup with validation, a don't-show-again option, delayed auto-open and a confirmation state.

Fullscreen Dialog on Mobile – Bootstrap 6 modals preview

Fullscreen Dialog on Mobile

Dark Bootstrap 6 Dialog for notification settings that is centered on desktop, fullscreen on phones, with a scrollable body of switches and a sticky footer.

Login Dialog with Social Buttons – Bootstrap 6 modals preview

Login Dialog with Social Buttons

Bootstrap 6 Dialog login form with Google, Apple and GitHub sign-in buttons, email and password fields, show-password toggle, validation and a success state.

Confirm Delete Dialog – Bootstrap 6 modals preview

Confirm Delete Dialog

Dark Bootstrap 6 Dialog that confirms deleting a file, with danger theme, focus on Cancel, per-row triggers, a loading state, row removal and an Undo toast.