Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Year In Review Reviews Block for React

Six superlatives worked out from a bakery's typed reviews: the first, the best month, the most helpful, the longest, the fastest after the visit and the most disagreed with, each shown with its review.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

A set of review superlatives for React with Base UI, for Fennhouse, a fictional neighbourhood bakery. A centred header counts the 16 typed reviews, then a band of six cells on shared hairlines, three by two, ends the block. Each cell names a superlative (the first review, the best month, the most helpful, the longest, the fastest after the visit, the most disagreed with), shows the figure that won it (a date, a month, a vote count, a word count, a number of days), says why in one line, and then shows the winning review in one line with its stars, title, reviewer and date. Every winner is computed when the file loads: the earliest date, the month with the best average among months with three or more reviews, the most helpful votes, the most words, the fewest days between the visit and the review, and the smallest side of the helpful and not-helpful votes. Nothing is picked by hand and nothing is coloured. On a phone the six cells stack and the sixth waits behind "Show all six". It's built from Rating, Button and Guides, with CSS transitions only.

FAQ

How do I use my own reviews?

Replace REVIEWS at the top of the file, oldest first. Each review has an id, name, rating from 1 to 5, an ISO date, the ISO date of the visit as bought, a title, a body, and its up and down vote counts. The six winners, their figures and their one-line reasons are all derived from those fields, so replacing the array replaces every cell.

How is each winner chosen?

The first review is the earliest date. The best month is the one with the highest average rating among months that have at least three reviews, and its cell shows that month's most helpful review. The most helpful has the most up votes; the longest has the most words; the fastest has the fewest days between the visit and the review; the most disagreed with has the largest smaller side of its up and down votes. Ties go to the earliest review in the list.

Is there a year picker?

No. It shows everything in the data, which here is the bakery's first season from June to October; the block is not tied to a calendar year. To show a different span, change the array.

How does it fit on a phone?

The cells stack in one column and the sixth is hidden until you press "Show all six", which flips its aria-expanded and keeps the hidden cell in the page. The review titles reserve two lines in every cell so the cells keep an even rhythm, and nothing scrolls sideways at 320 pixels.

Does it work right to left?

Yes. The cells and their text follow the page's direction, the stars are mirrored, and each date, figure and phrase with a number is isolated so it keeps its order.

  • Pro

    Heatmap Activity Reviews

    Insights and trends

    A sixteen-week calendar of review counts for a fitness band: each day a shaded button, and picking one lists that day's reviews as articles beside totals and the busiest day.

  • Pro

    Trend Overview Reviews

    Insights and trends

    A router's rating over twelve months as a line with monthly review-volume bars on one axis, a 6 or 12 month switch, a month Slider and a closing band reading that month's average, count and most helpful review.

  • Pro

    Helpful Votes Reviews

    Votes and replies

    The best favourable and the best critical review of a water filter jug side by side, each with a Helpful vote and a worked-out 'n of m found this helpful', above the other reviews in ruled rows with a most-helpful or newest order.

  • Pro

    Analytics Summary Reviews

    Insights and trends

    Six products of one outdoor shop ranked by their reviews: a sortable table of average, count, a five-segment ratings bar, the 30-day change and the answered share, all worked out from typed reviews.

  • Pro

    Upvote System Reviews

    Votes and replies

    Six reviews of a board game as cards with an Up and Down pill and a net score worked out from the votes, tabs for Top, New and Controversial, and a collapsible that folds reviews at a net of minus three or lower.

  • Pro

    A year in four quarters for a deploy platform, in a card in card: a Q1 to Q4 bar filled up to the chosen quarter, and under it that quarter's quote beside its deploys and uptime.