Review panel rail — Storefront block
Prostorefront-review-panel-rail · for product pages
Review panel rail
The rating, the photo strip and the filter chips gathered in a narrow rail beside compact review rows: a panel that sits next to the gallery, or floats as a dialog
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-review-panel-railUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import StorefrontReviewPanelRail from '@/components/trame/blocks/storefront/storefront-review-panel-rail.vue'
const props = {
title: "Customer reviews",
product: {
id: 2,
name: "Trail Path shoes",
rating: 4.4,
reviewCount: 128
},
average: 4.4,
count: 128,
distribution: [
{
rating: 5,
count: 6
},
{
rating: 4,
count: 3
}
],
reviews: [
{
id: 1,
author: "Camille R.",
rating: 5,
title: "Perfect from the very first hike",
text: "No blisters after twelve miles, the support is excellent and the sole grips well in the wet. I recommend them without hesitation for mountain hiking.",
date: "September 12, 2026",
verified: true,
images: [
"https://images.unsplash.com/photo-1575987116913-e96e7d490b8a?w=1600&q=80"
]
},
{
id: 2,
author: "Thomas B.",
rating: 4,
title: "Great value for the money",
text: "Comfortable on flat and rolling ground. Breathability is decent, though I’d have liked a bit more ventilation on top. True to size.",
date: "September 8, 2026",
verified: true,
images: [
"https://images.unsplash.com/photo-1602845860431-35374f24f48d?w=1600&q=80"
]
}
],
total: 128,
photos: [
"https://images.unsplash.com/photo-1575987116913-e96e7d490b8a?w=1600&q=80",
"https://images.unsplash.com/photo-1602845860431-35374f24f48d?w=1600&q=80"
],
filters: [
{
label: "All",
key: "all",
active: true,
count: 12
},
{
label: "5 stars",
key: "5",
count: 6
}
],
sorts: [
{
label: "Most recent",
key: "recent",
active: true
},
{
label: "Most helpful",
key: "helpful"
}
],
filterAction: "filter-reviews",
sortAction: "sort-reviews",
pageAction: "page-reviews",
currentPage: 1,
perPage: 12,
note: "Reviews are left by customers after their order arrives and checked before they’re published. We publish positive and negative reviews alike; no review is paid for.",
write: {
label: "Write a review",
action: "write-review",
record: {
id: 2
}
},
options: {
showVerified: true,
clampLines: 4
},
mode: "panel"
}
</script>
<template>
<StorefrontReviewPanelRail v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe section title ("Customer reviews") |
| product | Product | Datathe product whose reviews are listed |
| average | number | Datathe average rating, from the review store |
| count | number | Datathe total number of reviews, from the review store |
| distribution | Distribution[] | Datahow many reviews per star |
| reviews* | Review[] | Datathe reviews to show on this page |
| total | number | Datathe total number of reviews across all pages, for pagination |
| filters | Filter[] | the filters offered, e.g. "With photos" |
| sorts | Sort[] | the orders the reviews can be sorted in, e.g. "Most recent" |
| filterAction | string | Actionthe page action when a filter is clicked; it receives the filter key |
| sortAction | string | Actionthe page action when a sort is changed; it receives the sort key |
| pageAction | string | Actionthe page action for pagination; it receives the page number |
| more | string | Actionthe action that loads the next page of reviews; given, a "See more reviews" link replaces the pager |
| currentPage | number | Datathe current page number |
| perPage | number | Datahow many reviews per page |
| photos | string[] | Picturethe customer photo strip |
| mode | string | Designpanel — in the page (the rail beside the product gallery, the wall under it); dialog — the same reviews presented as a floating sheet |
| note | string | Wordshow the reviews are collected and checked, in the shop’s own words |
| write | Write | the visitor writes a review: shown only when the page has the action |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Product product · 4 props
| Prop | Type | Description |
|---|---|---|
| id* | string | number | Datathe record’s id in the tool that answers it |
| name* | string | Wordsthe product’s name |
| rating | number | the average of the shop’s own stored reviews |
| reviewCount | number | how many stored reviews the rating averages |
Distribution 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[] · 9 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 |
Filter filters[] · 4 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat the filter says ("With photos", "Verified purchase", "5 stars") |
| key* | string | Wordsthe filter key the host recognises |
| active | boolean | true: the one selected now |
| count | number | how many, as the host counted them |
Sort sorts[] · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat the sort says ("Most recent", "Most helpful") |
| key* | string | Wordsthe sort key the host recognises |
| active | boolean | true: the one selected now |
Write write · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe button ("Give my review") |
| action* | string | Actionthe mutation that sends the review |
| record | Record<string, unknown> | Datawhat the review is about (the product) |
Options options · 3 props
| Prop | Type | Description |
|---|---|---|
| showVerified | boolean | show the verified badge (on by default) |
| clampLines | number | how many lines before "Read more" (default 4) |
| 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 |
| asset | a picture’s address as your app serves it |
| 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:
filterAction,sortAction,pageAction,more,write - Reads
reviewsfrom your app
A storefront section, for product 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 form page: the product large on one side and the form beside it: the page a post-purchase email leads to.
- Review form steps: numbered steps down a rail, stars first, then the words, the photos and the name: a longer form with criteria and photos that should feel short.
- Review list photo first: reviews with customer photos shown as a grid first, then the rest: photo-heavy products where the pictures matter.
- Review list two column: the summary sticky on the left, reviews scrolling on the right: a wide screen where the summary stays visible.
- Review list: a single-column list of reviews with a summary header: the standard review page.
- 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.