Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Settings Config Reviews Block for React

Display settings for a soap shop's review widget: four Switch rows, an order Select and a lowest-rating Select beside a live preview card that follows each change, with a Save button.

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 review widget settings panel for React with Base UI, for Teaselline, a fictional soap shop. A divider splits the section, with the live card at the start and the settings at the end; on a phone it reads header, card, settings. The settings are four Switch rows (show reviewer names, show the verified mark, show helpful votes, show dates), an Order Select (newest, highest rated or most helpful first), a Select for the lowest rating to list, and one Shine Button, Save settings. The card, framed with + marks, is the widget as a shopper would see it: the average and count of every sample review on top, then up to two reviews that change as you flip a switch or choose an order, and a caption that says how many of the matching reviews it lists. Saving says "Saved in this demo only", and "You have unsaved changes" shows until you do. An unseen copy holds the card's height, so no switch moves the page. It's built from Switch, Select, Field, Rating, Avatar, Shine Button and Guides.

FAQ

How do I use my own reviews and options?

Edit REVIEWS (each has a rating, an ISO date, helpful votes, a title, a body and a verified flag), TOGGLES, ORDER_ITEMS and MIN_ITEMS at the top of the file. The card's average and count are computed from every review in REVIEWS; the list is those at or above the chosen rating, sorted, cut to MAX_SHOWN. Dates show without a year and carry a time element.

Does the lowest-rating setting hide bad reviews?

It only chooses which reviews the card lists. The average and the count above the list always include every review, the caption says how many matched, and the card ends with a "Read all" line. Use a setting like this to keep a small widget short, never to make a product look better than its reviews say; trimming the average itself, or hiding the way to read everything, misleads shoppers.

Where do the settings go when I press Save?

Nowhere. Save copies the current choices into a second piece of local state so the "unsaved changes" line can go, and a polite status says it was saved in this demo. To keep them, send the six values (four booleans and two strings) from the save handler to your own settings endpoint.

How are the switches named for screen readers?

Each is named by its label ("Show reviewer names") through aria-label, and the visible text and hint beside it are hidden from the accessibility tree so the label isn't read twice. The checked state uses your theme's text colour, so the Shine Button stays the one primary control. The handler receives the new checked value directly.

Why doesn't the card move when I flip a switch?

An unseen copy of the two tallest reviews, with every part switched on, sits in the same grid cell as the live list, and each review's text reserves three lines. The live list sits at the top of that cell, so hiding names or dates leaves the page where it is.

Does it work right to left?

Yes. The two columns swap sides with the page's direction, the stars fill from the start, and ratings, dates, counts and the caption's numbers are isolated so their digits keep their order.

  • Pro

    Export Panel Reviews

    Merchant tools

    A review export for a seed company: a format ToggleGroup, column Checkboxes and a ratings Select beside a framed live preview of the first three rows, with Download and Copy.

  • Pro

    An embeddable rating card with a Compact, Standard and Wide switch that reshapes the same figures, and a field with the matching embed snippet and a Copy button.

  • Pro

    A docked review widget on a drawn product page for a baby monitor: a tab that folds open to two named star ratings, one line of text, an optional photo name and a progress bar, with the three steps for embedding it beside it.

  • 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

    What is waiting for a reply at a ceramics studio: three worked-out cells (awaiting, replied this month, average rating) beside the queue of reviews that need an answer, each with an inline reply field and Send.

  • Pro

    A review summary with a Verified purchases only switch: the average, the count, the share rated four or more and five distribution rows are worked out again, with a delta line against all reviews.