Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Response Templates Reviews Block for React

Reply templates for a bike-repair shop: vertical Tabs for four categories with counts, the templates in each, a Select for the review being answered, an editable Textarea, a preview with marked variables and a Copy 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 reply template library for React with Base UI, for Eavesmill, a fictional bike-repair shop. Under a compact header, a band with a divider splits the section. At the start, vertical Tabs list four categories with their counts (Thanks 3, Apology 2, Parts delay 2, Refunds 2; chips in a row on a phone), and the open category lists its templates as pressable rows with a two-line excerpt. At the end, the working side: a Select to choose which review is being answered (four sample reviews with their stars and service), the review's words, a Textarea holding the chosen template with its {{first_name}} and {{product}} variables, a preview of the reply with those variables filled in from the review and marked with mark, and a Copy button that puts the filled-in text on the clipboard. Edits are kept per template, a variable that isn't recognised stays as typed and is counted, and nothing is sent. Every count comes from the typed templates. It's built from Tabs, Select, Textarea, Field, Badge, Copy Button and Guides.

FAQ

How do I add templates, categories and variables?

Add a category to CATEGORIES and templates to TEMPLATES (each with a category, a title and a body), and the tab counts follow. Variables are names in double braces: to add one, give fillOf the name and the value it stands for, and list the name in KNOWN so a typo is told apart from a real variable. The library here is typed example text for a fictional shop.

How are the variables filled in?

The Select picks one of the typed reviews, and the preview cuts the template into plain runs and variables: each known variable is replaced by that review's first name or service and wrapped in mark, and an unknown one such as a misspelt name stays as typed, still marked, with a line under the preview saying how many aren't recognised. Copy puts the filled-in text, not the template, on the clipboard.

What happens to my edits?

They stay with the template you edited, so switching to another and back keeps them; a reload starts afresh. Choosing a different review changes only the preview, never the Textarea. Nothing is saved or sent anywhere, and the page says so beside the Copy button.

How do the category Tabs and the template rows work?

Choosing a category opens its first template; pressing a row selects that template and marks it as pressed. An unseen copy of every category's list holds the height, so switching category never moves the page. The Tabs are vertical and controlled through value and onValueChange; the selected tab is marked data-active.

Does Copy work everywhere?

It uses the browser's clipboard, which needs a secure page (HTTPS or localhost) and, in some browsers, a click. When the clipboard refuses, the button says "Couldn't copy" through its live status instead of showing a check.

Does it work right to left?

Yes. The tab column, the rows and the working side follow the page's direction. The template text and its preview are ordinary paragraphs, so they take the page's direction too, and counts are isolated so their digits keep their order.

  • Pro

    Reply Thread Reviews

    Votes and replies

    One three-star dishwasher review with its conversation in a single framed window: the seller's reply, the buyer's follow-up and the seller again under depth rails, and a real reply form with a live character count that appends your reply to the end.

  • 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

    An SLA slider for review replies: set a reply-within target from 4 to 48 hours and see which of six team members meet it, with the team rate worked out from their reply times.

  • Pro

    A merchant review inbox for a greenhouse-kit maker: Tabs for All, Needs action and Replies with counts, a Mark all as read button and full-width ruled rows under day dividers with inline Approve, Reply and Mark read.

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