Skip to content

Product Listing Grid

Responsive Bootstrap 5 product grid with sale, new, bestseller and sold-out badges, color swatches, wishlist buttons, sorting and client-side pagination.

Also known as: product grid, ecommerce product list, shop category page, product catalog layout

Product Listing Grid live demo

Open in new tab

Bootstrap 5 code (HTML, CSS, JS)

A responsive Bootstrap 5 product listing grid for shop category pages and collection landing pages. It shows twenty sample products with status badges, ratings, sale prices and color swatches, and adds sorting and client-side pagination on top of a standard Bootstrap row.

How it works

The root .pl-shop has a header with the .pl-title heading, a .pl-summary status line and a .pl-sort__select dropdown. Products live in .pl-grid, a row whose .pl-item columns use col-6 col-md-4 col-lg-3, so the grid goes from two to three to four columns. Each .pl-card has an image area (.pl-card__media) with a .pl-badge and a round .pl-wish button, followed by the category, title link, rating, price and .pl-swatches. The .pl-card__link stretches over the whole card with a pseudo-element, while the wishlist button stays clickable above it. Sale prices turn the current price terracotta via :has(.pl-price__old), and .pl-card--soldout greys out the image.

The script reads data-pl-per-page and shows one page of .pl-item elements at a time, building the Bootstrap .pagination inside .pl-pages with previous, numbered and next buttons. Choosing a sort option reorders the columns in the DOM using data-pl-order, data-pl-price or data-pl-rating, then jumps back to page one. Changing pages updates the summary, scrolls to the top of the section and focuses the heading. Without JavaScript all products are visible.

Customization

  • data-pl-per-page on .pl-shop: show more or fewer products per page; the page buttons are rebuilt automatically.
  • --pl-accent in style.css: changes the "New" badge, the active page button and focus rings.
  • --pl-card-radius on .pl-shop: make the cards sharper or rounder.
  • Badge modifiers .pl-badge--new, .pl-badge--sale, .pl-badge--best and .pl-badge--soldout: swap or recolor the labels on each card.
  • col-6 col-md-4 col-lg-3 on .pl-item: change the column count at each breakpoint, e.g. col-lg-4 for three columns.
  • Add a sort option by adding an <option> to .pl-sort__select and a matching function to SORTERS in script.js.
  • .pl-swatch--sand, .pl-swatch--sage and the other swatch classes: set the dot colors to your product variants.

Use cases

  • Shop category pages: products with badges, ratings, sale prices and color swatches
  • Collection landing pages: a sortable grid for a seasonal or themed collection
  • Catalog prototypes: a quick starting point with sorting and pagination already wired up

Accessibility

The summary is a role="status" live region, so page and sort changes are announced. Pagination sits in a labelled nav; the current page has aria-current="page", arrows have aria-label values and disabled ends use the disabled attribute. Ratings are role="img" with text such as "Rated 4.8 out of 5", old prices include a hidden "Was" prefix and color dots are hidden from assistive tech with a text alternative. Wishlist buttons toggle aria-pressed. The whole card shows a focus outline when its link is focused, and hover and scroll animations respect prefers-reduced-motion.

Usage notes

Requires Bootstrap 5 (added automatically) and Bootstrap Icons. For large catalogs, render one page on the server and keep the same markup.

Product Listing Grid 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 Grids
License
Free for personal and commercial use

Questions about this template

Can I use the Product Listing Grid 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 Listing Grid – free Bootstrap 5 product grid template
Product Listing Grid · free Bootstrap 5 product grid template

More Product Grids

Product Grid with Filters – free Tailwind CSS product grid template

Product Grid with Filters

Tailwind CSS category page with a collapsible filter sidebar, live result count, empty state and a product grid sortable by price, rating or date.

Product Grid with Quick Add on Hover – free Tailwind CSS product grid template

Product Grid with Quick Add on Hover

Tailwind CSS product grid where a quick add bar slides up over each photo on hover or focus, with a live bag counter and wishlist toggle.