Message Actions
Action buttons for chat messages (copy, regenerate, edit, share, feedback). Provides a consistent interface for common message operations in chat applications.
Preview
Installation
Usage
Examples
Full Featured
For Assistant Messages
Typical actions for AI assistant responses:
For User Messages
Typical actions for user messages:
Compact Mode (Icon Only)
Use compact mode for space-constrained layouts:
Props
| Name | Type | Default | Description |
|---|---|---|---|
showCopy | boolean | true | Show copy button |
showRegenerate | boolean | false | Show regenerate button |
showEdit | boolean | false | Show edit button |
showShare | boolean | false | Show share button |
showFlag | boolean | false | Show flag/report button |
showFeedback | boolean | false | Show feedback buttons (thumbs up/down) |
onCopy | () => void | — | Callback when copy is clicked |
onRegenerate | () => void | — | Callback when regenerate is clicked |
onEdit | () => void | — | Callback when edit is clicked |
onShare | () => void | — | Callback when share is clicked |
onFlag | () => void | — | Callback when flag is clicked |
onThumbsUp | () => void | — | Callback when thumbs up is clicked |
onThumbsDown | () => void | — | Callback when thumbs down is clicked |
isRTL | boolean | false | Whether text direction is RTL |
compact | boolean | false | Compact mode (icon only) |
Accessibility
Screen Reader
All buttons include screen reader labels via sr-only spans, ensuring icon-only buttons are accessible. Feedback state changes are announced appropriately.
Keyboard Navigation
- Tab: Navigate between action buttons
- Enter or Space: Activate button
Visual Feedback
Copy button shows a checkmark when clicked. Feedback buttons change color when selected, providing clear visual feedback for user actions.
RTL Considerations
The action buttons work seamlessly in RTL layouts. Button labels appear in the correct language and icon spacing adapts automatically.
LTR (English)
RTL (العربية)
Related Components
Display chat messages with actions
Input component for sending messages
Loading state for AI responses