Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Masonry Layout Reviews Block for React

Twelve reviews of pruning shears as cards of every length in CSS columns, with a star filter, an order switch, a polite count and a Helpful vote on each card.

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 masonry of reviews for React with Base UI, for the Furrowmill Bypass Pruners, a fictional garden tool. A start-aligned header gives the count and the average (worked out from the twelve typed reviews), two toggle groups filter by stars (All, 5 stars, 4 stars, 3 and below) and set the order (Newest, Most helpful), and a polite line counts what shows. The cards sit in CSS columns, three across on a desktop, two on a tablet and one on a phone, read down each column. Each card is a full review with its own overshooting lines: the stars with their value in words, the title, the text, the reviewer with a verified mark, the date and a Helpful vote that counts once. An unseen copy of every card in both orders holds the height, so the page never moves. A phone masks the list at 520 pixels behind a "Show all reviews" button. It's built from Toggle Group, Toggle, Rating, Avatar and Guides.

FAQ

Which way do the cards read?

Down each column, then across: the browser balances CSS columns by height, so the newest review is at the top of the first column and the next ones follow beneath it. Each card is kept whole with break-inside-avoid. Reordering or filtering reflows the columns, which is why the cards are keyed by review.

Why doesn't the page move when I filter?

An unseen copy of all twelve cards, in both orders, shares the grid cell with the live columns. The cell keeps the height of the taller copy, so a filter that shows fewer cards leaves empty space under them rather than pulling the page up. Cards moving inside that fixed space are expected.

How do the two groups behave?

Each is a single choice that cannot be empty: pressing the chosen item again does nothing. The polite line says the result in words, such as "Showing 4 of 12 reviews: 3 and below, most helpful". Edit STAR_CHOICES and ORDER_CHOICES to change the options.

Do the Helpful votes go anywhere?

No. A vote changes the count on this page only, can be taken back, and is announced by a polite status line; nothing is sent. Wire onPressedChange to your API if you want to keep them.

How does it fit on a phone?

The filter and order groups stack full width, the cards form one column that is masked at 520 pixels, and "Show all reviews" (its button says whether the list is expanded) reveals the rest.

  • Pro

    Twenty reviews of a podcast app ten at a time in a fixed-height scroll region that appends five more at its end, with a Load more button, placeholder rows and a polite count.

  • Pro

    Paginated List Reviews

    Lists and pages

    Twenty-four reviews of a cookbook five to a page, with a page-size Select, the catalog pagination with ellipsis and a polite 'Showing 6 to 10 of 24'.

  • Pro

    Snippet Cards Reviews

    Cards and walls

    Eight review snippet cards on shared hairlines for a yoga mat: each leads with its most helpful sentence, and a Sheet opens the whole review with Previous and Next buttons and a polite counter.

  • Pro

    A wall of twenty-four bicycle light reviews as a mosaic whose tile size follows helpful votes, length or nothing, behind a Show all button.

  • Pro

    Filter Sort Bar Reviews

    Filter and search

    A toolbar band for rain-jacket reviews: a rating Select, a Verified toggle, a date Popover and a sort Select, a live count with removable chips, and the matching reviews as ruled rows.

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