Skip to main content
For development, import UserMediaMessage from @servicetitan/anvil2-ai-kit. For design, find it in the AI Kit Web Component Library file.

Common Examples

Pass one MediaAttachment through media and the required send timestamp. Copy defaults to media.fileName.
When showPreview is true, documents use a linked metadata row, images and videos expand above their metadata, and audio provides inline playback. Set it to false for the compact document-row treatment across all kinds.Pass error with onRetry to show a failed-send line and retry action. revealToolbarOnHover matches the user-message toolbar behavior.

Internationalization

Media playback uses the ai-kit.mediaAttachment.* messages. The action toolbar uses ai-kit.messageToolbar.*. Localize fileName, fileTypeLabel, and error before passing them.

React Accessibility

  • Image previews use alt, falling back to fileName.
  • Video and audio expose localized media controls.
  • Hover-hidden toolbars remain reachable from the keyboard and visible on touch.
Last modified on October 27, 2026