MessageItemView

Renders a message inside MessageList. Optimized to reduce unnecessary re-renders. This is the default component for the MessageItemView prop.

When enableSwipeToReply is enabled, swipe-to-reply wraps the full MessageItemView row rather than only the inner message bubble.

Best Practices

  • Keep custom message components lightweight to preserve list performance.
  • Use context-provided props (alignment, groupStyles) instead of re-computing them.
  • Avoid deep ChannelContext usage inside message rows to prevent re-renders.
  • Respect showMessageStatus and onlyEmojis when customizing UI.
  • Override subcomponents instead of replacing MessageItemView unless necessary.
  • Use MessageSpacer for row-level whitespace instead of replacing the full message row.
  • Use MessageContentTopView, MessageContentBottomView, MessageContentLeadingView, and MessageContentTrailingView for lightweight decoration around the message body instead of replacing MessageContent.

Props

PropDescriptionType
alignmentSets whether the message aligns left or right in the list. Defaults to 'right'.enum('right', 'left')
channelChannel instance from the Stream Chat client.Channel
enableMessageGroupingByUserIf false, consecutive messages from the same user won't be grouped. Available in SDK version >= v3.9.0. Defaults to true.boolean
groupStylesPosition of the message within a group of consecutive messages from the same user. Use groupStyles to style messages based on position (for example, avatars show only on the last message).array of enum('top', 'bottom', 'middle', 'single')
hasReactionsTrue if the message has at least one reaction.boolean
isMyMessageTrue if the message was sent by the current user.boolean
lastGroupMessageWhether or not this is the last message in a group of messages.boolean
membersMembers of current channel. Returns only up to 100 members; use client.queryMembers() for larger channels.object
messageMessage object.Message type
onlyEmojisTrue if the message text contains only emojis.boolean
otherAttachmentsAll attachments except file and image.array
showMessageStatusWhen false, message status (read receipt, pending indicator) isn't rendered. Defaults to true for messages sent by the current user.boolean
MyMessageThemeTheme applied to the current user's messages. Memoize this object or pass a stable reference.object

UI Component Props

PropDescriptionType
MessageAuthorRenders the sender avatar in MessageList. Only shown for other users' messages. Defaults to MessageAuthor.ComponentType
MessageContentRenders message content (status, attachments, reactions, etc.) in MessageList. For lighter decoration, prefer MessageContentTopView, MessageContentBottomView, MessageContentLeadingView, and MessageContentTrailingView. Defaults to MessageContent.ComponentType
MessageDeletedRenders a deleted message. Defaults to MessageDeleted.ComponentType
MessageFooterRenders the message footer in MessageList. Defaults to MessageFooter.ComponentType
MessageHeaderRenders the header for a message in MessageList.ComponentType
MessagePinnedHeaderRenders the pinned message label in MessageList.ComponentType
MessageRepliesShows thread reply count and avatars of users who replied. Defaults to MessageReplies.ComponentType
MessageSpacerRenders a prop-less spacer inside the outer message row. If omitted, nothing is rendered. Provide your own component through Channel or MessagesContext, and use useMessageContext() inside it if you need state such as alignment. Defaults to undefined.ComponentType | undefined
MessageStatusRenders message status (time and read receipts). Defaults to MessageStatus.ComponentType
ReactionListBottomRenders the reactions list below the message bubble. Defaults to ReactionListBottom.ComponentType
ReactionListPositionPosition of the reaction list in the message component. Defaults to 'top'.'top' | 'bottom'
ReactionListTopRenders the reactions list above the message bubble. Defaults to ReactionListTop.ComponentType