Skip to main content

Common Examples

To use the AgentMessage, pass content and a required timestamp. The row left-aligns the content and reserves a 24px inline-end gutter. The kit forbids children.
content accepts a string, inline markup, or a Markdown tree. Copy is text-only: pass copyText when content is rich so the copy action stays available.

Feedback

Wire onLike and onDislike to show thumbs. The component reflects currentFeedback; toggling is yours. When feedback is set, the toolbar shows a confirmation line.Omit both handlers to hide feedback entirely.

Internationalization

The action toolbar owns these localized strings:
  • ai-kit.messageToolbar.copy
  • ai-kit.messageToolbar.copied
  • ai-kit.messageToolbar.like
  • ai-kit.messageToolbar.removeLike
  • ai-kit.messageToolbar.dislike
  • ai-kit.messageToolbar.removeDislike
  • ai-kit.messageToolbar.feedbackThanks
  • ai-kit.messageToolbar.assistantActions
Localize content before passing it. Mount AiKitIntlProvider inside CartoTheme to switch the toolbar strings.

React Accessibility

  • The toolbar groups assistant actions under a localized name.
  • Timestamp is always present in the toolbar.
  • Feedback buttons announce like, dislike, and selected state.
Last modified on August 28, 2026