---
agent:
  instructions: "Search goop.so for Goop's components, templates, design skill, docs, pricing and terms. Ask in keywords or a plain question, such as \"date picker props\" or \"is the design skill free\"; the answer is the matching page sections in Markdown, each with its address."
  endpoint: "https://goop.so/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Reply actions

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.

Pro. Its export: `ReplyActions`.

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

```sh
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-reply-actions.json --yes
```

```text
Add the Goop Reply actions to this project. The install steps are at https://goop.so/docs/install.md
```

## Usage

```tsx
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 as `text`.
- width, gap: add no class for these.

## API reference

### Options

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

## Keyboard

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

## Related

- [Chat message](/themes/meadow/components/chat-message): One message of a conversation: its author, its body and when it was sent, often an avatar and actions.
- [Reply status](/themes/meadow/components/reply-status): The line an AI reply shows while it thinks and after it.
- [Sortable list](/themes/meadow/components/sortable-list): A list of rows a person puts in order, by dragging a row's handle or by the keys (Space, the arrows, Space), each step said aloud.
- [Tab bar](/themes/meadow/components/tab-bar): A phone screen's bottom navigation.
