Info:
This is documentation for Stream Chat Angular SDK v4, which is no longer actively maintained. For up-to-date documentation, see the latest version (v7).

MessageReactionsComponent

The MessageReactions component displays the reactions of a message, the current user can add and remove reactions. You can read more about message reactions in the platform documentation.

Example 1 - displaying reactions of a message:

Message Reactions Screenshot

Example 2 - displaying the reacting users - only visible if a message has at maximum 1200 reactions:

Reaction Details

Example 3 - adding/removing a reaction:

Message Reactions Selector Screenshot

Basic usage

A typical use case for the MessageReactions component would be to use in your custom components that will completely override the message component.

@Component({
  selector: "app-custom-message",
  template: `
    <stream-message-reactions
      [isSelectorOpen]="isReactionSelectorOpen"
      [messageId]="message.id"
      [messageReactionCounts]="message.reaction_counts"
      [latestReactions]="message.latest_reactions"
      [ownReactions]="message.own_reactions"
    ></stream-message-reactions>
    <!-- Other parts of the custom message component -->
  `,
})
export class CustomMessageComponent {
  @Input() message: StreamMessage;
  isReactionSelectorOpen: boolean;
}

Customization

You can override the default reactions using the MessageReactionsService.

You can provide your own UI for the reaction details using the MessageReactionsService.

You can provide your own message reactions component by the CustomTemplatesService.

Inputs and outputs

messageId

• messageId: undefined | string

The id of the message the reactions belong to

Defined in

lib/message-reactions/message-reactions.component.ts:38


messageReactionCounts

• messageReactionCounts: Object = {}

The number of reactions grouped by reaction types

Defined in

lib/message-reactions/message-reactions.component.ts:42


isSelectorOpen

• isSelectorOpen: boolean = false

Indicates if the selector should be opened or closed. Adding a UI element to open and close the selector is the parent's component responsibility.

Defined in

lib/message-reactions/message-reactions.component.ts:47


latestReactions

• latestReactions: ReactionResponse<DefaultStreamChatGenerics>[] = []

List of reactions of a message, used to display the users of a reaction type.

Defined in

lib/message-reactions/message-reactions.component.ts:51


ownReactions

• ownReactions: ReactionResponse<DefaultStreamChatGenerics>[] = []

List of the user's own reactions of a message, used to display the users of a reaction type.

Defined in

lib/message-reactions/message-reactions.component.ts:55


isSelectorOpenChange

• Readonly isSelectorOpenChange: EventEmitter<boolean>

Indicates if the selector should be opened or closed. Adding a UI element to open and close the selector is the parent's component responsibility.

Defined in

lib/message-reactions/message-reactions.component.ts:59

Add Chat to my app: getstream.io/SKILL.md

The fastest way to build with Stream. Start a new project or improve an existing one. Full CLI and documentation integration out of the box.


Ask your agent:

/stream Build me a Social App with Feeds and Moderation.
/stream Any livestream calls running?
/stream Chat Angular v4: <Your Question>