shadcn.io is not affiliated with official shadcn/ui
Copy Reply FAQ Block for React
A support playbook FAQ for a help desk: each situation opens on the team's advice and a reply to send, with its length in characters and a Copy reply button.
Installation
Overview
A reply-playbook FAQ for React with Base UI. A start column holds the title, one sentence and a note on filling in the placeholders; beside it a framed list of six customer situations, each with a badge for its channel. A situation opens on the team's advice and the reply to send, in a box with its length in characters and a Copy reply button that puts the whole text on the clipboard. On a phone the note and the frame stack. It's built from Accordion, Copy Button, Badge and Guides, with CSS transitions for the entrance and your theme's tokens for every colour. For internal help centres, support handbooks and any FAQ whose answers are meant to be pasted somewhere else.
FAQ
What does Copy reply copy?
The reply exactly as the box shows it, line breaks included, with the placeholders still in it. The button swaps its copy icon for a check for three seconds and a polite status says "Copied" to screen readers. If the browser refuses clipboard access (a page that isn't served over HTTPS), the icon becomes a cross and the status says "Couldn't copy" instead.
Are the placeholders filled in?
No. A word in double braces, like {{first_name}}, is for the agent to replace before sending; the sentence under the title says so, and on a desktop a note in the start column explains it. Wire your own data in if you want them filled: the reply is a plain string in SITUATIONS.
Where does the character count come from?
It's the length of the reply string, computed from the same data the box prints, so it can't drift from the text. It counts the placeholders as written, since that's what's copied.
How do I change the situations?
Edit SITUATIONS at the top of the file: each entry is an id, the question (the situation), a note of advice, the reply and its channel, "Chat" or "Email". OPEN_QUESTION names the one that's open on load.
One answer is open at a time.
How does it work with a keyboard and a screen reader?
Each situation is a button inside its own h3, and the open answer holds the advice, a labelled reply box and the Copy reply button, which is the only tab stop inside it. The reply's length is read as a number of characters.
Related
- Pro
Share Popover FAQ
Reading and sharingA FAQ for an event ticketing platform whose open answer ends in a Share button: a popover with a copy-link button, an email and a QR code of the answer's link.
- Pro
Anchor Link FAQ
Reading and sharingA FAQ for a documentation host with a # link on every question that copies its address, and deep links that open and ring the matching answer on load.
- Pro
Code Snippet FAQ
Code and mediaAn SDK FAQ for a webhook service: five questions whose answers are code windows with curl, Node and Python tabs and a copy button, in a band of hairline rows.
- Pro
Support Ticket FAQ
Contact and signupA ticket form that tries to make itself unnecessary, for a form builder: common questions at the start, and at the end a form on a card in card whose subject finds matching answers as you type.
- Pro
Feedback FAQ
Votes and reactionsA centred FAQ for a scheduling app: seven accordion rows whose open answers end in a Was this helpful? foot with Yes and No, reason chips after a No, and a polite thank-you.
- Pro
Multi-Language FAQ
Reading and sharingAn FAQ in English, Spanish and Arabic for a relocation service: a language switcher swaps the title, questions and answers, and sets lang and dir so Arabic lays the block out from its end.