shadcn.io is not affiliated with official shadcn/ui
Tagged Categories Reviews Block for React
A tag sidebar for plant-subscription reviews: eight tags with counts and frequency bars as toggles, an all-or-any Switch, a live count, and reviews that carry their tags as pills.
Installation
Overview
Tagged reviews for React with Base UI, for Trellismoor, a fictional houseplant subscription. A header with the title and one sentence (the average and the count, worked out from the reviews) sits over a band split by a divider. At the start, a tag sidebar: eight tags (plant health, variety, value, packaging, care cards, delivery, pots, support) as cells on shared hairlines, each a toggle that shows its name, how many of the twelve reviews carry it, a bar sized against the most-used tag and, once pressed, a check and a solid tint. Under the tags, a Switch makes the chosen tags "all" rather than "any". At the end, a live line ("Showing 5 of 12 reviews") and the matching reviews, five at a time, each with its stars and their value in words, a title, the text, the reviewer with an initials avatar, a "Verified purchase" mark in words, a fixed date and its tags as pills, the chosen ones filled. When no review carries all the chosen tags, an empty state says so. On a phone the tags become a row that scrolls sideways above the reviews. It's built from Toggle Group, Switch, Badge, Rating, Avatar, Empty and Guides, with CSS transitions only.
FAQ
How do I use my own reviews and tags?
Edit TAGS (an id and a label each) and REVIEWS at the top of the file; each review lists the ids of its tags. The counts, the bar widths (against the most-used tag), the average and the matches are all worked out from them, so adding a tag or a review needs no other change. The list shows PAGE matches at a time (five), newest first.
What does the Switch change?
With it off, a review matches when it carries any of the chosen tags; with it on, only when it carries all of them. With no tag chosen every review shows, and the Switch changes nothing. The live line says which rule applied, for screen readers: "Showing 2 of 12 reviews, tagged all of Value, Variety".
Why doesn't the page move when I choose a tag?
An unseen copy of the five tallest reviews sits in the same grid cell as the live list and the empty state, so the cell is always as tall as a full list. The status line and Clear button keep their places, and the tag cells have a fixed size.
How does it fit on a phone?
The sidebar becomes a row of tag cells that scrolls sideways, then the Switch, then the reviews, so the tags and the first review share the first screen. The cells keep their bars, counts and checks, and pressing one never moves the page.
Related
- Pro
Tag Cloud Reviews
Insights and trendsA word cloud for coffee-bean reviews in a framed figure: eighteen words sized by how often the reviews say them, and a keyword-in-context list that shows every mention of the chosen word with who said it.
- Pro
Keyword Mentions Reviews
Insights and trendsA topic table for sofa reviews: mentions found by keywords, a share bar and the average rating of the reviews that mention each topic against the overall average, sortable, with the matching reviews under it.
- Pro
Search Reviews
Filter and searchA search-first review section for a ceramic pot: a large field with suggestions mined from the reviews, per-star result chips that follow the query, a best-match or newest order, and results with every match marked.
- Pro
Advanced Sort Reviews
Filter and searchA filter panel for tent reviews: a sort key, an order, star pills, a recency segment and a verified Switch beside the matching reviews, with removable chips, a live count and a bottom Sheet on phones.
- Pro
Tag Filter Testimonials
Filter and searchA wall of nine customer quotes for a component kit in hairline cells, each ending in two topic tags that are buttons: pick one to filter the wall and get a removable chip.
- Pro
Tag Cloud Blog
Topics and indexesA foraging blog's tag cloud: fourteen tags in five sizes derived from their post counts, each a toggle that lists its three latest posts in a fixed-height panel beside the cloud.