Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-reply-actions.json --yes

Reply actions

Pro

The row of actions under an AI answer that copies it, rates it good or bad and asks for it again, for React and Tailwind CSS. Part of Goop Pro.

When to use

  • The row of actions under an AI answer that copies it, rates it good or bad and asks for it again.

Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Reply actions on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.

Terminal
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-reply-actions.json --yes
PROMPT
Add the Goop Reply actions to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import { ReplyActions } from '@/components/ui/goop/reply-actions';
import { useState } from 'react';
import { ChatMessage } from '@/components/ui/goop/chat-message';
import { Avatar } from '@/components/ui/goop/avatar';

function Answer({ text }: { text: string }) {
  const [rating, setRating] = useState<'good' | 'bad' | null>(null);
  const [retrying, setRetrying] = useState(false);
  return (
    <ChatMessage
      author="Assistant"
      avatar={<Avatar variant="solid" name="Assistant">AI</Avatar>}
      time="09:46"
      actions={
        <ReplyActions
          text={text}
          rating={rating}
          onRate={setRating}
          askReason
          onReason={(reason) => send({ rating, reason })}
          onRetry={() => setRetrying(true)}
          retrying={retrying}
        />
      }
    >
      {text}
    </ChatMessage>
  );
}
  • Fits: chat (its recipe).
  • Under an assistant's answer, as the message's actions: <ChatMessage actions={<ReplyActions text={answer} onRate={save} onRetry={regenerate} />}>. Pass the same words the message shows as text.
  • width, gap, background: add no class for these.

API reference

Options
OptionTypeWhat it does
text?stringThe answer's words, put on the clipboard by the copy button; with none, no copy button.
rating?'good' | 'bad' | nullThe rating (controlled): good, bad or null for none.
defaultRating?'good' | 'bad' | null = nullThe rating it starts with (uncontrolled).
onRate?(rating: 'good' | 'bad' | null) => voidCalled on every press of good or bad, with the new rating: null when the chosen one was pressed again.
askReason?boolean = falseA press that rates the answer bad also opens an optional reason field under the row.
onReason?(reason: string) => voidCalled with the reason typed (trimmed) when it is sent; an empty reason sends nothing.
onRetry?() => voidCalled by the try-again button; with none, no try-again button.
retrying?boolean = falseThe answer is being written again: the try-again button is busy and takes no press.
onCopy?(text: string) => voidCalled with text once it is on the clipboard.
labels?Partial<ReplyActionsLabels>The words it says, any of them replaced.
  • data-slot values (to select a part by): reply-actions, reply-actions-reason, reply-actions-row

Keyboard

KeyWhat it does
TabMove left to right: copy, good, bad, try again (with the reason open: then the field, Cancel and Send)
Enter SpaceOn copy: write the answer to the clipboard, its glyph a check and "Copied" said politely; on good or bad: choose it (aria-pressed), the other cleared, or clear it when already chosen; with askReason, bad also opens the optional reason field, focused; on try again: call it, unless busy
EnterIn the reason field: send the typed reason (Shift+Enter breaks the line), the focus back on bad
EscapeIn the reason: close it with nothing sent, the focus back on bad

Accessibility

  • The part itself answers the keys above.
  • hover, active: the browser's own (:hover, :active): write nothing

Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:

StateDrawn by
pressedthe attribute data-state=on
expandedthe attribute data-state=open
openthe attribute data-state=open

Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

goop.so/themes/trail/components/reply-actions.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-reply-actions.json --yes

Where would you like to start?

Free · now

The Goop plugin

A design system for your AI coding agent, so screen ten matches screen one.

/plugin marketplace add goop-so/skillsthen /plugin install goop@goopCodex, Cursor, ChatGPT, the Claude app and more: Connect Goop
FreePro

The components

Every part live, with its props, its keys and what an agent sees. Whole page and app templates, working with sample data.