npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-reply-actions.json --yesReply actions
ProThe 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.
What an agent sees
import { useState } from 'react';
import { ChatMessage } from '@/components/ui/goop/chat-message';
import { ReplyActions } from '@/components/ui/goop/reply-actions';
function Answer({ text, send }: { text: string; send: (feedback: object) => void }) {
const [rating, setRating] = useState<'good' | 'bad' | null>(null);
const [retrying, setRetrying] = useState(false);
return (
<ChatMessage
author="Assistant"
time="09:46"
actions={
<ReplyActions
text={text}
rating={rating}
onRate={setRating}
askReason
onReason={(reason) => send({ rating, reason })}
onRetry={() => setRetrying(true)}
retrying={retrying}
/>
}
>
{text}
</ChatMessage>
);
}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.
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-reply-actions.json --yesAdd the Goop Reply actions to this project. The install steps are at https://goop.so/docs/install.mdUsage
import { useState } from 'react';
import { ChatMessage } from '@/components/ui/goop/chat-message';
import { ReplyActions } from '@/components/ui/goop/reply-actions';
function Answer({ text, send }: { text: string; send: (feedback: object) => void }) {
const [rating, setRating] = useState<'good' | 'bad' | null>(null);
const [retrying, setRetrying] = useState(false);
return (
<ChatMessage
author="Assistant"
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 astext. - width, gap: add no class for these.
API reference
| Option | Type | What it does |
|---|---|---|
| text? | string | The answer's words, put on the clipboard by the copy button; with none, no copy button. |
| rating? | 'good' | 'bad' | null | The rating (controlled): good, bad or null for none. |
| defaultRating? | 'good' | 'bad' | null = null | The rating it starts with (uncontrolled). |
| onRate? | (rating: 'good' | 'bad' | null) => void | Called on every press of good or bad, with the new rating: null when the chosen one was pressed again. |
| askReason? | boolean = false | A press that rates the answer bad also opens an optional reason field under the row. |
| onReason? | (reason: string) => void | Called with the reason typed (trimmed) when it is sent; an empty reason sends nothing. |
| onRetry? | () => void | Called by the try-again button; with none, no try-again button. |
| retrying? | boolean = false | The answer is being written again: the try-again button is busy and takes no press. |
| onCopy? | (text: string) => void | Called 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
| Key | What it does |
|---|---|
| Tab | Move left to right: copy, good, bad, try again (with the reason open: then the field, Cancel and Send) |
| Enter Space | On 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 |
| Enter | In the reason field: send the typed reason (Shift+Enter breaks the line), the focus back on bad |
| Escape | In the reason: close it with nothing sent, the focus back on bad |
Accessibility
- The part itself answers the keys above.
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.