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.
Installation
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.
Related
- Pro
Reply Thread Reviews
Votes and repliesOne 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
Merchant Dashboard Reviews
Merchant toolsWhat 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
Response Rate Panel Reviews
Merchant toolsAn 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
Notification Feed Reviews
ModerationA 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
Moderation Queue Reviews
ModerationA 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 Queue Reviews
ModerationFlagged 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.