shadcn.io is not affiliated with official shadcn/ui
Top Rated Testimonials Block for Vue
Four reviews of an operations app with a sort control in the header: most helpful, highest rated or newest, re-ordered live from typed numbers, in one band of ruled rows with a status line and an average.
Installation
Overview
Reviews that answer to the reader, for Vue with Ark UI. A compact header ("Read the reviews in the order you need", with a bold lead about Backroom, a fictional operations app for small practices) carries a pill-shaped sort control at its end with three choices: most helpful, highest rated and newest. Under it, one band between the page's rails holds a summary line, which says how the list is sorted and gives the average rating computed from the reviews, and four review rows divided by hairlines. Each row pairs its metadata (foreground stars, how long ago, how many people found it helpful) with a titled review, and the review that tops the rating sort carries a "Top rated" badge wherever it lands. Rows fade in on each change, and nothing moves with reduced motion. It's built from Segment Group, Badge, Avatar and Guides, with Lucide icons, CSS transitions only and your theme's tokens; it has no button, so there's no primary colour in it. For product pages, marketplaces and docs sites where visitors want to scan reviews their own way.
FAQ
How do I use my own reviews?
Edit REVIEWS at the top of the file. Each review has its stars, a helpful count, an age in days for the "Newest" sort, and the same age as words in when. The three orders, the average and the "Top rated" badge are derived from those numbers, so nothing is ordered by hand.
How are ties broken?
"Highest rated" puts the most helpful review first among equal ratings, which is also how the "Top rated" badge is chosen. "Most helpful" and "Newest" sort on one number each.
How are the lines drawn?
Guides bleed marks="top" rules="top" on the page column draws the rails and the top rule. The band under the header has its own Guides marks="top" rules="top" sides={false}, and the rows start with a second one, so the summary line sits between two ruled lines with plus marks on the rails; the rows themselves are divided by divide-y. The block ends in its last row without a bottom rule: the next section draws its own top rule.
How does it work with a keyboard and a screen reader?
The sort control is a radio group named "Sort reviews by", with arrow keys between choices. After every change a polite status line reads out, for example "4 reviews, sorted by highest rated". Each review's stars are decorative and read as "Rated 5 out of 5". The stars are in foreground tones, with empty ones in the border colour.