Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Trend Overview Reviews Block for React

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.

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 rating trend for React with Base UI, for the Newelmill Hub, a fictional wifi router. The header's title is worked out from the data (the lowest month and the latest: "From 3.4 in Jan to 4.6 in Sep") and a ToggleGroup at its end switches between the last 6 and the last 12 months. In a framed figure, a line draws each month's average rating and bars draw how many reviews arrived that month, on the same months, in your theme's text colour at different strengths. A Slider under the chart picks a month with the arrow keys, Home and End as well as the pointer, and a marker line and ringed dot follow it. A closing band of three cells under the frame reads the month: its average and its review count as rolling figures, and its most helpful review with stars, title, text, reviewer, date and helpful count. Every month holds the typed star ratings of its reviews (one digit each), so the averages, the counts, the line, the bars, the hidden table for screen readers and the band can never disagree. It's built from Frame, Slider, Sliding Number, Rating, Toggle Group and Guides, with a hand-drawn SVG line and CSS only.

FAQ

How do I use my own months?

Replace MONTHS at the top of the file. A month has an id ("2026-03"), ratings (a string with one digit per review, 1 to 5, in any order) and top, its most helpful review (title, body, name, rating, helpful and an ISO date). The count is the length of the string and the average is worked out in tenths, so nothing is typed twice. The chart scales from 3.0 to 5.0; widen the heightOf range if your ratings fall below 3.

Is the most helpful review chosen from the data?

It is a typed review that you choose per month: the file keeps one top review for each month rather than every review's helpful count. Its star rating should be one of the digits in that month's ratings; it is not checked for you. The averages and counts, which are what the chart draws, come only from the digits.

How does the month Slider work?

It has one stop per visible month, under the month's own column, and a hidden label "Month" with a spoken value such as "Mar 2026, average 4.0". Arrow keys step a month, Home and End jump to the first and last. Switching to 6 months keeps the chosen month when it is still in view and otherwise moves to the first of the six. The band's polite status line reads out the new month.

What is the text equivalent of the chart?

A table inside the figure, hidden visually, lists each visible month with its reviews and average. The drawing itself is hidden from screen readers, and the figure's caption names what it shows.

Does it work right to left?

The chart, its labels and the Slider keep their left-to-right order so time still runs forward and the thumb lines up with its column; the header, the toggle and the band follow the page's direction, and each phrase with a figure is isolated.

How does it fit on a phone?

The plot is 208 pixels high, a 12-month view labels the months by initial, and the band's three cells stack. The review in the band reserves two lines for its title and three for its text, so changing the month never moves the page.

  • 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

    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

    A review summary for a carry-on suitcase whose star rows filter the reviews: the average, the count, the share that would recommend it and a five-row distribution, beside the four most helpful reviews with a Helpful vote each.

  • Pro

    A rating distribution for a hiking boot: five ruled rows of bars, counts and shares, a Bars and Table switch, and a readout of mean, median, mode and the share rated four or more.

  • Pro

    Timeline Feed Reviews

    Lists and pages

    Twelve reviews of a smart thermostat on a month-by-month timeline with each month's derived average and count, review cards on shared hairlines and a firmware filter.

  • Pro

    Year In Review Reviews

    Insights and trends

    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.