Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Response Templates Reviews Block for Radix UI

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