Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Reply Composer Notification Block for React

A reply notification with the quoted original (clamped, with Show more), the reply in full and a composer that sends a local reply into a mini thread, with Edit.

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

Answer a reply from the notification itself, with this reply notification for React with Base UI. A compact header sits over one hairline frame with a plus mark on each corner. The first band says who replied and where; under it come what you wrote, clamped to two lines with a Show more Button, and then their reply in full. The last band is yours: Reply back opens a Textarea with a character counter (120 at most), Control or Command and Enter send, and a sent reply joins the thread as your message with "Sent in this demo" and an Edit button that brings it back to the box. The idle button, the box and the sent message share one cell, with an unseen copy of the longest sent reply, and the quote keeps the height of its full text, so opening, sending or editing never moves a line. It's built from Textarea, Button, Avatar and Guides, with a CSS entrance only. For a design critique or review tool, a forum or any inbox where people answer back.

FAQ

How do I fill it with my own reply?

Edit the constants at the top of the file: THEM is who replied and when, BOARD where, ORIGINAL is what you wrote, REPLY what they answered and ME your initials. MAX is the reply limit, and the unseen copy that holds the room for the longest sent reply is built from it, so changing the limit keeps the height right.

What happens when I send, and what stays local?

Nothing leaves the page. Send (or Control or Command and Enter inside the box) keeps the text in the page, shows it as your message with "Sent in this demo" and moves focus to Edit; an empty reply is refused in words and focus stays in the box. Edit puts the text back in the box, and sending again updates it. To make it real, send the text to your backend in the post handler and show a failure in the status line under the thread.

Which keys send, and what does the counter say?

Control and Enter on most systems, Command and Enter on an Apple device: the hint shows the right one after the page loads. A plain Enter adds a line. The counter ("12 / 120") is for the eye; the polite status line says only when it matters, at 20 and 10 characters to go and at the limit, so a screen reader is not read every keystroke.

Why does the quote have a gap under it when it is clamped?

The quote's band keeps the height of the full text in an unseen copy, so Show more and Show less never push the reply and the box down. The gap shrinks as the screen widens and the text needs fewer lines.

Is it accessible?

Show more is a button that reports whether the quote is expanded and names it. The box has a label (visually hidden) and a description that spells out the keys. Cancel returns focus to Reply back or to Edit, whichever opened the box, and the unseen layers are inert, so Tab only reaches what is showing.

How does it look on a phone?

Everything stacks as it is. The key hint is dropped under the small breakpoint (the description still carries it), Cancel and Send stay in one row with the counter, and the cell is tall enough for the longest reply at 320 pixels.

  • Pro

    A followed thread with the facts at the start (topic, five people, a Mute thread toggle) and the replies in the frame in two levels, each branch folding its answers.

  • Pro

    Review comments grouped by file, each quoting the line it is about, with a Resolve toggle that moves a comment into a collapsed resolved group and back.

  • Pro

    A writing app's feedback card drawn over its drafts page: five stars, a question that follows the rating, a thank-you that stays on the page, and a memory in the tab so it asks once and Ask again brings it back.

  • Pro

    An AI assistant's empty history in a framed window: the sidebar says No chats yet, a drawing of three stacked speech cards and four prompt chips lead to a log and composer with sample replies.

  • Pro

    Mentions seen through four chips (All, @you, @team, @channel) with counts, each snippet marking its tag, naming its channel and offering Jump to message.

  • Pro

    Two posts with who reacted in a sentence, reaction chips (icons and counts) that open a card listing each person, and a Thank everyone button with Undo.