ReactionListTop

ReactionListTop displays reactions above a message. This is the default component for the ReactionListTop prop.

Best Practices

  • Keep reaction lists compact to avoid covering message content.
  • Use supportedReactions to keep available reactions consistent.
  • Avoid heavy logic in press handlers for smooth interactions.
  • Keep reaction sizes consistent across the app.

Basic Usage

Use case: Override the background color on the reaction list container.

import {
  WithComponents,
  ReactionListTop,
  ReactionListTopProps,
} from "stream-chat-react-native";

const ReactionListTopWithCustomBackground = (props: ReactionListTopProps) => (
  <ReactionListTop {...props} fill="#00DDDD" />
);

<WithComponents
  overrides={{ ReactionListTop: ReactionListTopWithCustomBackground }}
>
  <Channel channel={channel}>
    <MessageList />
    <MessageComposer />
  </Channel>
</WithComponents>;

Props

PropDescriptionType
alignmentSets whether the message aligns left or right in the list. Defaults to 'right'.enum('right', 'left')
fillBackground color for reaction list container when alignment is left.string
hasReactionsTrue if the message has at least one reaction.boolean
onLongPressDefault long press handler for message UI.function
onPressDefault press handler for message UI.function
onPressInDefault pressIn handler for message UI.function
preventPress
reactionsReactions added to the message.array
reactionSizeReaction icon size.number
showMessageOverlayOpens the message action overlay (called on long press).(showMessageReactions?: boolean) => void
supportedReactionsList of reactions users can add to messages. See customizing reactions. Defaults to reactionData.array

Examples

Reactions data structure:

[
  {
    own: true,
    type: "love",
  },
  {
    own: false,
    type: "haha",
  },
];