Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Tag Cloud Reviews Block for React

A 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.

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 word cloud for React with Base UI, for Fennstead, a fictional coffee-bean roaster. A header with the title and one sentence (the average and the count, worked out from the reviews) sits over two parts. At the start, a framed figure with corner marks holds a cloud of eighteen words, each a button sized in four steps by how often the twelve typed reviews say it; the counts come from the text, not from a typed list. At the end, a keyword-in-context list: press a word and every mention of it appears as one line, a few words before it, the word marked at the centre and a few after, with the reviewer's stars and their value in words, their name and the date, under a live line such as "7 mentions in 7 reviews". The cloud is plain type, with no drawing, and the chosen word is filled in your theme's text colour. On a phone the cloud comes first and the lines wrap as ordinary sentences. It's built from Toggle Group, Rating and Guides, with CSS transitions only.

FAQ

How do I use my own reviews and words?

Replace REVIEWS and WORDS at the top of the file. The mention counts, the four size steps, the list for each word and the line under the heading are all worked out from the review text when the module loads: a word counts wherever it appears as a whole word, ignoring case and punctuation. Pick words that appear at least twice, or the cloud shows an almost empty list.

How are the sizes chosen?

Each word's count is placed between the least and the most mentioned word and mapped to one of four type sizes, so the cloud always spans the full range whatever your data. The size is only a hint: each button's accessible name says the count ("sweet, 7 mentions"), and the live line says it again in words when you choose one.

What are the lines in the list?

One line per mention, not per review, so a review that says the word twice gives two lines. Each shows up to four words before the mention and five after, cut at the review's own ends, with an ellipsis where more text follows. From the small breakpoint the mention sits at the centre of a three-column line; below that the same words wrap as a sentence with the mention marked. Lines are shown in English, so they keep their own direction in a right-to-left page.

Why doesn't the page move when I choose a word?

An unseen copy of the list for the most-mentioned word sits in the same grid cell as the live list, so the cell is always as tall as the longest one. The figure never changes size, because a chosen word only changes colour.

How do I use it from the keyboard?

Tab into the cloud, move between words with the arrow keys and press Space or Enter to choose one; the list and the count change at once and the count is read out politely. One word is always chosen, so there is no empty state.

Does it work right to left?

Yes. The two parts swap sides, the cloud and the heading follow the page's direction, stars are mirrored so they fill from the start, and counts and dates are isolated so their digits keep their order. The context lines are left to right on purpose, like code, because they quote English text.

  • Pro

    Keyword Mentions Reviews

    Insights and trends

    A 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

    Tagged Categories Reviews

    Filter and search

    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.

  • Pro

    Search Reviews

    Filter and search

    A 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

    Three reading-lamp reviews with hand-picked phrases marked by a plus or minus glyph, and a phrase index of toggles with counts that makes only the chosen kinds of phrase stand out.

  • Pro

    Five customer quotes about a UI kit, set large in ruled bands under keyword chips: pick one and every quote that mentions it marks the words, lights a bar and counts where it comes up.

  • Pro

    Tag Cloud Blog

    Topics and indexes

    A 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.