A chat message component that displays messages from users, assistants, or system prompts with optional avatars.

npx slipstream-ui@latest add message
Playground
U
You
Hello, how are you today?
Roles & streaming
U
You
Hello, how are you?
A
Assistant
I'm doing well, thank you!
system
System initialized
A
Assistant
Generating a response token by tok

Props

PropTypeDefaultDescription
messageMessagerequiredThe message object with role, content, and metadata
showAvatarbooleantrueWhether to show the avatar
avatarSrcstringundefinedCustom avatar image URL
avatarFallbackstringundefinedFallback text for avatar
userLabelstring'You'Display name for user messages (localization)
assistantLabelstring'Assistant'Display name for assistant messages (localization)
renderContent(content: string) => ReactNodeundefinedCustom content renderer (e.g. markdown); replaces plain-text rendering
isStreamingbooleanfalseShows a typing cursor and sets aria-busy while generating

Accessibility

  • Message role and content are announced by screen readers
  • Avatar has proper alt text from fallback or role
  • System messages have distinct visual styling
  • Timestamps are properly formatted for accessibility