Skip to content

Testimonials Grid

Masonry-style Tailwind CSS testimonials grid with star ratings, initial avatars and an accessible Show more button.

Also known as: testimonial section, customer reviews grid, masonry testimonials, social proof section

Testimonials Grid live demo

Open in new tab

Tailwind CSS code (HTML, CSS, JS)

A masonry-style testimonials section built with Tailwind CSS, showing customer quotes in cards of different heights with star ratings, initial avatars, names and roles. A "Show more reviews" button reveals extra quotes on demand. Use it on landing pages, pricing pages or anywhere social proof helps visitors decide.

How it works

The root is section.tg-testimonials on a warm bg-amber-50 background. The header pairs the #tg-title heading with a summary badge showing the average rating.

The masonry effect comes from CSS multi-column layout rather than JavaScript. The wrapper div.tg-grid uses columns-1 sm:columns-2 lg:columns-3, and every card has break-inside-avoid and mb-6, so cards of any height flow top to bottom and never split across columns. Each card is a figure.tg-card containing a star row, a blockquote and a figcaption with a colored initials avatar. One card is styled as a dark bg-stone-900 highlight to break the rhythm and draw the eye.

Three extra cards carry data-tg-extra and the hidden attribute. On DOMContentLoaded the script finds every .tg-testimonials root and listens for clicks on button.tg-more. A click toggles hidden on the extra cards, adds .tg-card--in for a short fade-and-rise animation, flips aria-expanded, swaps the [data-tg-label] text between "Show more reviews" and "Show fewer reviews", and rotates .tg-chevron via .tg-more--open. Without JavaScript the first six reviews still display normally.

Customization

  • lg:columns-3 on .tg-grid: change to lg:columns-4 for a denser wall of quotes, or lg:columns-2 for wider cards.
  • data-tg-extra with hidden and tabindex="-1": add these to any figure.tg-card to move it behind the "Show more" button; if no card has data-tg-extra, the script hides the button.
  • --tg-reveal-duration in style.css: lengthen or shorten the fade-in of revealed reviews.
  • aria-label="Rated 5 out of 5" on each star row: update it together with the star colors (text-amber-500 for filled, text-stone-300 for empty) when a rating changes.
  • bg-stone-900 card: move these classes to another figure to highlight a different quote, or replace them with the white card classes for a uniform grid.
  • Avatar span with bg-teal-700 and initials: swap for an img from https://placehold.co/88x88 or your own photos with rounded-full.
  • bg-amber-50 on the section and border-amber-200/70 on cards: change both for a new palette.

Use cases

  • Landing pages: customer quotes appear in cards of different heights with star ratings
  • Pricing pages: initial avatars, names and roles add credibility next to the plans
  • Long review lists: a Show more reviews button reveals extra quotes on demand
  • Social proof: the masonry layout makes many reviews look balanced and varied

Accessibility

Each quote uses figure, blockquote and figcaption, the semantic pattern for attributed quotations. Star rows have role="img" with an aria-label such as "Rated 4 out of 5", while the individual stars and avatars are aria-hidden. The toggle button uses aria-expanded and aria-controls, an aria-live="polite" status in [data-tg-status] announces the change, and focus moves to the first revealed review so keyboard users keep their place. Focus rings use focus-visible:outline-2, and the reveal animation and chevron rotation are disabled under prefers-reduced-motion: reduce.

Usage notes

Requires the Tailwind browser build (added automatically). Several sections can share a page because the script scopes all queries to each .tg-testimonials; give each copy unique tg-title and tg-list ids and update aria-controls.

Testimonials Grid at a glance

Framework
Tailwind CSS
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
Tailwind CSS
Layout
Responsive, works on mobile
Category
Testimonials
License
Free for personal and commercial use

Questions about this template

Can I use the Testimonials 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 Tailwind CSS 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):

  • <script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>

The Tailwind browser build is for prototyping. In production, compile Tailwind with its CLI or your bundler.

Testimonials Grid – free Tailwind CSS testimonial template
Testimonials Grid · free Tailwind CSS testimonial template

More Testimonials

Testimonial with Large Portrait Photo – free Tailwind CSS testimonial template

Testimonial with Large Portrait Photo

Featured Tailwind CSS testimonial with a large customer portrait, offset frame, serif quote, star rating and result metrics.

Single Testimonial with Large Quote – free WordPress testimonial template

Single Testimonial with Large Quote

A single testimonial for the block editor with a large centered customer quote, round portrait, name, role and company wordmark on a deep navy background.

Testimonial Cards with Avatars – free WordPress testimonial template

Testimonial Cards with Avatars

Testimonial cards for the block editor: three customer reviews with five-star ratings, round portrait avatars, names and roles on a warm light background.

Customer Testimonials Section for Shopify – free Shopify testimonial template

Customer Testimonials Section for Shopify

A Shopify section for customer quotes with star ratings, avatars and linked products, shown as a grid or a scrolling row with previous and next buttons.

Scroll-Snap Testimonial Slider – free Pure CSS testimonial template

Scroll-Snap Testimonial Slider

Horizontally scrolling testimonial cards using CSS scroll snap, with star ratings, avatars and accessible previous and next buttons.