# MessageActions

Copy, retry, edit and feedback buttons for a message, each showing whether it worked.

- **Use it for**: Copy, retry, edit and quick feedback on a reply.
- **Not for**: Feedback with reasons and corrections. Try [FeedbackCapture](https://unseenui.com/components/feedback-capture/).

## Installation

```bash
npm install @stackunseen/ui
```

## Usage

```tsx
import { MessageActions } from '@stackunseen/ui';
import '@stackunseen/ui/styles.css';

<MessageActions variant="toolbar" text={message.text} onRetry={retry} />
```

## All props

| Prop | Type | Description |
| --- | --- | --- |
| `children` | `ReactNode` | Extra actions such as Read aloud or Share, placed after the built-in ones. |
| `className` | `string` |  |
| `editAvailability` | `{ available: boolean; reason?: string; }` | Host-owned action availability; callbacks remain intents. |
| `feedbackValue` | `"helpful" \| "unhelpful"` | The rating already recorded for this message; shows as a pressed button. |
| `onEdit` | `(() => void)` |  |
| `onFeedback` | `((helpful: boolean) => void)` |  |
| `onRetry` | `(() => void)` |  |
| `retryAvailability` | `{ available: boolean; reason?: string; }` |  |
| `retryLabel` | `string` |  |
| `text` (required) | `string` |  |
| `variant` | `"compact" \| "toolbar" \| "vertical"` |  |

## Keyboard

Tab reaches controls; Enter or Space activates buttons. Accordions use arrow keys, Home and End. Select menus support arrows and typeahead; Escape closes menus and dialogs and restores focus.

## Works with

[Chat](https://unseenui.com/components/chat/), [PromptInput](https://unseenui.com/components/prompt-input/), [Message](https://unseenui.com/components/message/), [StreamingResponse](https://unseenui.com/components/streaming-response/), [Suggestions](https://unseenui.com/components/suggestions/), [Attachment](https://unseenui.com/components/attachment/), [AttachmentTray](https://unseenui.com/components/attachment-tray/), [FileDropzone](https://unseenui.com/components/file-dropzone/), [ModelSelector](https://unseenui.com/components/model-selector/), [FeedbackCapture](https://unseenui.com/components/feedback-capture/), [Reasoning](https://unseenui.com/components/reasoning/), [SuggestTextarea](https://unseenui.com/components/suggest-textarea/)

Page: https://unseenui.com/components/message-actions/
