Review panel rail — Storefront block

Pro

storefront-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-rail

Usage

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.

PropTypeDescription
title*stringWordsthe section title ("Customer reviews")
productProductDatathe product whose reviews are listed
averagenumberDatathe average rating, from the review store
countnumberDatathe total number of reviews, from the review store
distributionDistribution[]Datahow many reviews per star
reviews*Review[]Datathe reviews to show on this page
totalnumberDatathe total number of reviews across all pages, for pagination
filtersFilter[]the filters offered, e.g. "With photos"
sortsSort[]the orders the reviews can be sorted in, e.g. "Most recent"
filterActionstringActionthe page action when a filter is clicked; it receives the filter key
sortActionstringActionthe page action when a sort is changed; it receives the sort key
pageActionstringActionthe page action for pagination; it receives the page number
morestringActionthe action that loads the next page of reviews; given, a "See more reviews" link replaces the pager
currentPagenumberDatathe current page number
perPagenumberDatahow many reviews per page
photosstring[]Picturethe customer photo strip
modestringDesignpanel — in the page (the rail beside the product gallery, the wall under it); dialog — the same reviews presented as a floating sheet
notestringWordshow the reviews are collected and checked, in the shop’s own words
writeWritethe visitor writes a review: shown only when the page has the action
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Product product · 4 props
PropTypeDescription
id*string | numberDatathe record’s id in the tool that answers it
name*stringWordsthe product’s name
ratingnumberthe average of the shop’s own stored reviews
reviewCountnumberhow many stored reviews the rating averages
Distribution distribution[] · 2 props
PropTypeDescription
rating*numberthe star level, 1 to 5
count*numberhow many, as the host counted them
Review reviews[] · 9 props
PropTypeDescription
id*string | numberDatathe record’s id in the tool that answers it
author*stringWordswho wrote the review, as the shop shows it
rating*numberthe stars given, 1 to 5
titlestringWordsthe review’s title
text*stringWordsthe review, in the customer’s words
datestringWordswhen it was written, as the shop writes it
verifiedbooleanbought in the shop, as the shop recorded it
imagesstring[]Picturea picture: a root-relative path (/media/…) or an absolute URL
replystringWordsthe merchant’s reply
Filter filters[] · 4 props
PropTypeDescription
label*stringWordswhat the filter says ("With photos", "Verified purchase", "5 stars")
key*stringWordsthe filter key the host recognises
activebooleantrue: the one selected now
countnumberhow many, as the host counted them
Sort sorts[] · 3 props
PropTypeDescription
label*stringWordswhat the sort says ("Most recent", "Most helpful")
key*stringWordsthe sort key the host recognises
activebooleantrue: the one selected now
Write write · 3 props
PropTypeDescription
label*stringWordsthe button ("Give my review")
action*stringActionthe mutation that sends the review
recordRecord<string, unknown>Datawhat the review is about (the product)
Options options · 3 props
PropTypeDescription
showVerifiedbooleanshow the verified badge (on by default)
clampLinesnumberhow many lines before "Read more" (default 4)
mood'inverse' | 'brand' | 'warm' | 'tint' | stringa 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).

MemberWhat it is for
hrefthe address an action leads to, or null to hide what leads there
actruns a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error }
canwhether the page has this action
asseta picture’s address as your app serves it
Linkyour router’s link component
cartCountthe cart badge’s number
cartDrawerwhether your app has a cart drawer
cartOpenwhether the cart drawer is open
labelyour 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:

KeyEnglishFrench
newsletter.alreadyYou are already subscribed.Vous êtes déjà inscrit.
newsletter.doneDone: you are subscribed.C’est noté : vous êtes inscrit.
newsletter.invalidCheck the email address.Vérifiez l’adresse e-mail.
newsletter.tooManyToo 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 reviews from 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.

All 409 storefront blocks