Reviews summary pair — Storefront block
Prostorefront-reviews-summary-pair · for product, home, catalog pages
Reviews summary pair
A product page that wants to be believed: the most helpful positive review beside the most helpful critical one; the merchant’s own only
Documentation
Installation
One command copies the block into your project with the shadcn CLI (the registry is set once: Installation).
pnpm dlx shadcn-vue@latest add @trame/storefront-reviews-summary-pairUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import StorefrontReviewsSummaryPair from '@/components/trame/blocks/storefront/storefront-reviews-summary-pair.vue'
const props = {
heading: "What our customers say",
summary: {
count: 12,
average: 4,
distribution: [
{
rating: 5,
count: 6
},
{
rating: 4,
count: 3
}
]
},
reviews: [
{
id: "r1",
author: "Camille",
rating: 5,
title: "Exactly what I hoped for",
text: "The canvas is thick, the seams are clean and the color matches the photos. I’ve used it every day for a month.",
date: "September 12, 2026",
verified: true,
helpful: 14,
product: "Canvas tote bag",
images: [
"https://images.unsplash.com/photo-1617500603321-bcd6286973b7?w=1600&q=80"
]
},
{
id: "r2",
author: "Julien",
rating: 4,
title: "Very good, a bit pricey",
text: "Great quality, fast delivery. I’m taking off one star because the price felt high for the size.",
date: "September 3, 2026",
verified: true,
helpful: 6,
product: "Canvas tote bag"
}
],
all: {
label: "See all reviews",
action: "reviews"
},
write: {
label: "Write a review",
action: "review-form"
},
options: {
perPage: 6,
note: "Reviews are published as received, after we check that they’re about our products. We don’t remove negative reviews."
}
}
</script>
<template>
<StorefrontReviewsSummaryPair v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| heading* | string | Wordsthe section’s title ("Customer reviews") |
| summary | Summary | Datacomputed by the shop from all its stored reviews, never typed: when absent, the block counts the reviews it is given |
| reviews* | Review[] | Datathe reviews to show, as stored (a page of them is fine) |
| all | All | the see-all link: its words and the page action it runs |
| write | Write | the write action: its words and the page action it runs |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Summary summary · 3 props
| Prop | Type | Description |
|---|---|---|
| average | number | the average rating, 1 to 5 |
| count* | number | how many, as the host counted them |
| distribution | Distribution[] | how many reviews give each star level |
Distribution summary.distribution[] · 2 props
| Prop | Type | Description |
|---|---|---|
| rating* | number | the star level, 1 to 5 |
| count* | number | how many, as the host counted them |
Review reviews[] · 11 props
| Prop | Type | Description |
|---|---|---|
| id* | string | number | Datathe record’s id in the tool that answers it |
| author* | string | Wordswho wrote the review, as the shop shows it |
| rating* | number | the stars given, 1 to 5 |
| title | string | Wordsthe review’s title |
| text* | string | Wordsthe review, in the customer’s words |
| date | string | Wordswhen it was written, as the shop writes it |
| verified | boolean | bought in the shop, as the shop recorded it |
| images | string[] | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| reply | string | Wordsthe merchant’s reply |
| helpful | number | how many visitors found it helpful, as the shop recorded it |
| product | string | Wordsthe product it is about, when the block is not on that product’s page |
All all · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat the link says ("See the 312 reviews") |
| action* | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action opens (a product), if any |
Write write · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat the link says ("See the 312 reviews") |
| action* | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action opens (a product), if any |
Options options · 4 props
| Prop | Type | Description |
|---|---|---|
| perPage | number | how many reviews show before "See more" (6 by default) |
| showVerified | boolean | show "Verified purchase" where the shop recorded it (on by default) |
| note | string | Wordshow reviews are collected and moderated, as the merchant states it: never claimed by default |
| mood | 'inverse' | 'brand' | 'warm' | 'tint' | string | a band of the page that redefines the theme surfaces inside it |
What it asks your app for
The block never knows your app: it asks it, through one context provided once, where its links lead, what its actions do, how a price reads and which words to say (The host context).
| Member | What it is for |
|---|---|
| href | the address an action leads to, or null to hide what leads there |
| act | runs a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error } |
| can | whether the page has this action |
| Link | your router’s link component |
| cartCount | the cart badge’s number |
| cartDrawer | whether your app has a cart drawer |
| cartOpen | whether the cart drawer is open |
| label | your word for an interface key, or undefined to keep the block’s own |
The words it says itself, in English and French; label(key) replaces any of them:
| Key | English | French |
|---|---|---|
| newsletter.already | You are already subscribed. | Vous êtes déjà inscrit. |
| newsletter.done | Done: you are subscribed. | C’est noté : vous êtes inscrit. |
| newsletter.invalid | Check the email address. | Vérifiez l’adresse e-mail. |
| newsletter.tooMany | Too many attempts, try again in a moment. | Trop de tentatives, réessayez dans un moment. |
Features
- Every word in the server HTML
- Same markup in Vue and React
- Theme tokens only: every theme, light and dark
- Shows what you give it, invents nothing
- Subtle motion: one short reveal; still under reduced motion
- Real buttons and links, a visible focus
- Asks your app through actions:
all,write - Reads
reviewsfrom your app
A storefront section, for product, home, catalog pages; it uses @lucide/vue, @vueuse/core, class-variance-authority, clsx, reka-ui, tailwind-merge.
Built with
The components this block is made of; each one installs on its own too.
More storefront blocks
- Review panel wall: the score, its bars and the customer photos in one wide band, the filters and sorts in a toolbar, then the reviews as cards in balanced columns: a full-width reviews section under the product, with many reviews to browse; the customers’ own reviews only.
- Review signal pill: a small pill above a heading carrying the rating and the count: a signal that introduces a title; the merchant’s own only.
- Review snapshot distribution scales: clothes, shoes and gear where fit and comfort decide the purchase: the bars plus dot-on-track scales from reviewers.
- Review snapshot distribution: a product page that wants the average and the five star bars at a glance, with a link to every review.
- Saved cards card faces: Each saved card beside a neutral drawn face (its label, a chip mark, the last four digits, the expiry; no network logo): a customer with two or three cards who recognises them by sight.
- Saved cards list with explainer: The merchant’s actual storage explanation beside masked processor records and their controls.
- Saved cards list: A compact masked payment-method list for an existing account panel, with the storage statement below.
- Saved for later folded: a single line "Saved for later (3)" that opens on compact rows: a cart drawer or a long cart page where the saved products must not compete with the cart.