# ActionBarPrimitive
URL: /docs/api-reference/primitives/action-bar
Buttons for message actions like copy, edit, reload, speak, and feedback.
Buttons to interact with the message.
Anatomy \[#anatomy]
```tsx
import { ActionBarPrimitive } from "@assistant-ui/react";
const UserMessageBar = () => (
);
const AssistantMessageBar = () => (
);
```
API Reference \[#api-reference]
Root \[#root]
Contains all parts of the action bar.
This primitive renders a `
` element unless `asChild` is set.
| Data attribute | Values |
| ----------------- | --------------------- |
| `[data-floating]` | Present when floating |
Edit \[#edit]
Enables edit mode on user message.
This primitive renders a `
` element unless `asChild` is set.
Reload \[#reload]
Regenerates the assistant message.
This primitive renders a `` element unless `asChild` is set.
Copy \[#copy]
Copies the message to the clipboard.
This primitive renders a `` element unless `asChild` is set.
| Data attribute | Values |
| --------------- | --------------------------------------------- |
| `[data-copied]` | Present when the message was recently copied. |
Copied state \[#copied-state]
Show a different icon for a few seconds after the message is copied.
```tsx
!s.message.isCopied}>
s.message.isCopied}>
```
or using the `data-copied` attribute:
```tsx
```
Speak \[#speak]
Plays the message text as speech.
This primitive renders a `` element unless `asChild` is set.
StopSpeaking \[#stopspeaking]
Stops the message text from being played as speech.
This primitive renders a `` element unless `asChild` is set.
Feedback Positive \[#feedback-positive]
Shows a positive feedback submission button.
This primitive renders a `` element unless `asChild` is set.
| Data attribute | Values |
| ------------------ | --------------------------------------------- |
| `[data-submitted]` | Present when positive feedback was submitted. |
Feedback Negative \[#feedback-negative]
Shows a negative feedback submission button.
This primitive renders a `` element unless `asChild` is set.
| Data attribute | Values |
| ------------------ | --------------------------------------------- |
| `[data-submitted]` | Present when negative feedback was submitted. |
ExportMarkdown \[#exportmarkdown]
Exports the message content as a Markdown file download by default, or calls a custom export handler when `onExport` is provided.
This primitive renders a `` element unless `asChild` is set.
Examples \[#examples]
Default Markdown export:
```tsx
Export as Markdown
```
With custom filename:
```tsx
Download
```
Export as PDF (with custom logic):
```tsx
{
const pdf = await generatePdf(content);
downloadFile(pdf, "message.pdf");
}}
>
Export PDF
```
Export as JSON:
```tsx
{
const json = JSON.stringify({ content, timestamp: Date.now() });
const blob = new Blob([json], { type: "application/json" });
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = "message.json";
a.click();
URL.revokeObjectURL(url);
}}
>
Export JSON
```