Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Bulk Actions Reviews Block for React

Ten skincare reviews in a sortable table with status tabs and counts, a select-all checkbox with a partial state, and a closing action band to Publish, Hide or Delete the chosen rows, Delete behind a confirm dialog.

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 bulk-moderation table for React with Base UI, for Heathhouse, a fictional skincare line. A start-aligned header counts the reviews from the data, then status tabs (All, Pending, Published, Hidden) each carry a count that changes as rows change state. A real table runs rail to rail under them: a select-all checkbox that shows a dash when only some rows are chosen, then sortable Rating, Reviewer and Date heads, the review's title and first line, and a status as a shape and a word. Choosing rows wakes the band that closes the block: "3 selected" with Publish, the Shine Button, Hide and Delete, which asks first in a Dialog and says deleting is for abuse, spam and personal data, never for a low rating. Each action changes the rows here and says so in a polite line. It's built from Table markup, Tabs, Checkbox, Dialog, Badge, Rating and Shine Button. On a phone the Reviewer and Date columns drop and the band wraps.

FAQ

How do I change the reviews?

Edit REVIEWS at the top of the file: each review has a start status (pending, published or hidden) and, for a hidden one, a held reason shown under its title. The tab counts, the "10 reviews, 4 pending" line and the table rows are worked out from the current status of each row, so the numbers always match what the table shows.

How does select all work?

The checkbox in the head chooses every row of the open tab, shows a dash when only some of them are chosen and clears them when pressed again. Changing tab clears the choice, so "3 selected" never counts rows you can't see. Each row's checkbox is named with its title, so a screen reader says what is being chosen. The dash is drawn by the block itself, because this checkbox draws a tick in its partial state.

What does Delete do?

It opens a Dialog that says how many reviews are about to go and that deleting is for abuse, spam and personal data, with "hide a review instead if you are not sure". Confirming removes the rows from this table and the counts drop; nothing is deleted anywhere and a reload starts afresh. Publish and Hide change the status only, and the line in the band says what was done and that nothing is published in this demo.

Why doesn't the table jump when I change tab?

An unseen copy of the full table sits in the same grid cell as the open panel, so the block is always as tall as the All tab started out, whichever tab is open, whatever you delete. The band is outside the panels, so it never moves either.

How does sorting work?

Rating, Reviewer and Date heads are buttons, and the head's aria-sort follows the order. Each column starts in its natural direction (best, A to Z and newest first), and pressing it again reverses it. The order applies to whichever tab is open; ties fall back to the review's id so it never shuffles.

Does it work right to left?

Yes. The select column, the heads and the cells follow the page's direction, and dates, counts and ratings are each wrapped so their digits stay in order. The sort arrows don't mirror: up and down mean the same everywhere.

  • Pro

    A keyboard triage queue for a marketplace: eight held reviews with a progress line, and the review in focus with Approve, Reject and Escalate, each on a key, a polite status line and Undo.

  • Pro

    Flagged reviews of a travel-guide series as accordion rows ordered by report count, each opening to the reasons tally, the reporters, the review and two decisions: Dismiss flags, or Remove review behind a confirm dialog.

  • Pro

    Twelve reviews of an appliance-repair firm in four state lanes (New, In review, Replied, Resolved), each card with a Move to menu instead of dragging, counts worked out from where the cards sit.

  • Pro

    Compact List Reviews

    Lists and pages

    Twelve one-line reviews of a notes app as a real table with sortable column heads, a Select that mirrors the sort, and nothing to open.

  • Pro

    One review's route to the page as a Steps band (Submitted, Checks, Read by a person, Published) with its three checks, a short activity log and Advance and Send back, for any of five submitted reviews.

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