Product Reviews Section
A rating summary with a per-star distribution chart, plus a review list with working helpful votes and a load more toggle. Built for a product page's reviews tab.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button, badge, avatar, avatar-initials dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/product-reviews-section.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/ecommerce/ecommerce11.tsx instead.
Usage
The file also exports ecommerce11Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.
import { Ecommerce11, ecommerce11Demo } from "@/components/blocks/ecommerce/ecommerce11"; export default function Page() { return <Ecommerce11 {...ecommerce11Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | "Customer reviews" | Heading above the rating summary. |
| averageRating | number | none | Average rating, e.g. 4.6, shown large and rounded to one decimal. |
| reviewCount | number | none | Total review count shown under the average rating. |
| distribution | RatingDistributionRow[] | [] | Percentage bars from 5 stars down to 1 star. |
| reviews | Review[] | none | Reviews shown immediately. |
| moreReviews | Review[] | [] | Additional reviews revealed by the Load more button. |
| className | string | none | Extra classes for the outer section element. |
Types
type RatingDistributionRow = { stars: 5 | 4 | 3 | 2 | 1; percentage: number; // 0-100, rendered as the bar's fill width }; type Review = { id: string; name: string; avatar?: { src: string; alt: string }; verified?: boolean; rating: number; date: string; // pre-formatted, e.g. "July 18, 2026" text: string; helpfulCount: number; // initial count before any local Helpful clicks };
Behavior notes
- The Helpful button is genuinely functional: clicking it increments that review's counter in local useState, seeded from each review's helpfulCount prop. It resets on remount, nothing is persisted.
- Load more reveals the fixed moreReviews list via a real useState toggle, not a fetch; the button disappears once clicked or is never shown if moreReviews is empty.
- The distribution bars and star icons are static visuals rendered from the distribution/rating props; there is no interactive filtering by star count.
- A review without an avatar prop falls back to initials built from its name, same pattern as the About blocks.
More Ecommerce Blocks
View all →wishlist-manager
Wishlist Manager
Saved-items list with stock-status badges, move-to-cart and remove actions, and a real empty state.
product-information-tabs
Product Information Tabs
Tabbed product details with Description, Features, Specifications, Reviews, and Shipping panels.
collection-showcase-grid
Collection Showcase Grid
A large featured-collection hero card alongside a grid of smaller supporting collection tiles.
shop-by-brand-grid
Shop by Brand Grid
A grid of bordered brand tiles with a wordmark-style name, product count, and a hover affordance.
sale-countdown-timer
Sale Countdown Timer
A live days/hours/minutes/seconds countdown in default, compact, or full-width banner layouts.
gift-card-redemption-form
Gift Card Redemption Form
A code-entry form that validates against a fixed list of demo gift cards and shows a real success or error state.