> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-rn-guide-message-privately.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Reaction Info

> Reaction Info — CometChat documentation.

## Overview

The `Reaction Info` component provides a visual representation of a tooltip details about emoji reactions on a message, helping users easily see which emojis were reacted by whom.

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/NN4EdpOU3viwWMb_/images/0c053eff-reaction_info_overview_web_screens-44a5370ecbd2bb455ca7ab17855181bd.png?fit=max&auto=format&n=NN4EdpOU3viwWMb_&q=85&s=7c5fd3dc84e2c60a7bf73a1ba0f1ec72" width="3600" height="2400" data-path="images/0c053eff-reaction_info_overview_web_screens-44a5370ecbd2bb455ca7ab17855181bd.png" />
</Frame>

## Usage

### Integration

The following code snippet illustrates how you can directly incorporate the Reactions Info component into your app.

<Tabs>
  <Tab title="app.module.ts">
    ```ts theme={null}
    import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from "@angular/core";
    import { BrowserModule } from "@angular/platform-browser";
    import { AppComponent } from "./app.component";

    @NgModule({
      imports: [BrowserModule],
      declarations: [AppComponent],
      providers: [],
      bootstrap: [AppComponent],
      schemas: [CUSTOM_ELEMENTS_SCHEMA],
    })
    export class AppModule {}
    ```
  </Tab>

  <Tab title="app.component.ts">
    ```ts theme={null}
    import { CometChat } from '@cometchat/chat-sdk-javascript';
    import { Component, OnInit } from '@angular/core';
    import {  CometChatThemeService, CometChatUIKit } from '@cometchat/chat-uikit-angular';
    import { ReactionInfoStyle } from '@cometchat/uikit-shared';
    import "@cometchat/uikit-elements";

    @Component({
      selector: 'app-root',
      templateUrl: './app.component.html',
      styleUrls: ['./app.component.css']
    })
    export class AppComponent {

      constructor(private themeService:CometChatThemeService) {
        themeService.theme.palette.setMode("light")
        themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
      }
      public messageObject!: CometChat.TextMessage;
      reactionInfoStyle = new ReactionInfoStyle({
        background:'#631aeb',
        borderRadius:'20px',
        width:'200px',
      });
      ngOnInit(): void {
        CometChat.getMessageDetails("messageId").then((message) => {
            this.messageObject = message;
        }).catch((error) => {
          console.error('Error fetching message details:', error);
        });
      }

      onLogin(UID?: any) {
        CometChatUIKit.login({ uid: UID }).then(
          (user) => {
            setTimeout(() => {
              window.location.reload();
            }, 1000);
          },
          (error) => {
            console.log("Login failed with exception:", { error });
          }
        );
      }
    }
    ```
  </Tab>

  <Tab title="app.component.html">
    ```html theme={null}
    <div class="fullwidth">
      <cometchat-reaction-info
        *ngIf="messageObject"
        [messageObject]="messageObject"
        [reaction]="'\ud83e\udd21'"
        [reactionInfoStyle]="reactionInfoStyle"
      ></cometchat-reaction-info>
    </div>
    ```
  </Tab>
</Tabs>

***

### Actions

[Actions](/ui-kit/angular/components-overview#actions) dictate how a component functions. They are divided into two types: Predefined and User-defined. You can override either type, allowing you to tailor the behavior of the component to fit your specific needs.

The `Reactions Info` component does not have any exposed actions.

### Filters

**Filters** allow you to customize the data displayed in a list within a `Component`. You can filter the list based on your specific criteria, allowing for a more customized. Filters can be applied using `RequestBuilders` of Chat SDK.

You can adjust the `ReactionsRequestBuilder` in the Reaction Info Component to customize your Reaction info. Numerous options are available to alter the builder to meet your specific needs. For additional details on `ReactionsRequestBuilder`, please visit [ReactionsRequestBuilder](/sdk/javascript/reactions).

In the example below, we demonstrate the application of a filter to the `reactions info`. This filter allows you to specify a limit on the number of users displayed who have reacted with the same emoji.

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/21UBnagXOw-XG0Sv/images/ad3f79f1-reaction_info_filter_web_screens-b4fe56d6a29a60ea9e196be34af25d77.png?fit=max&auto=format&n=21UBnagXOw-XG0Sv&q=85&s=a9fd71737be6b10e0dd4389f77b5102d" width="3600" height="2400" data-path="images/ad3f79f1-reaction_info_filter_web_screens-b4fe56d6a29a60ea9e196be34af25d77.png" />
</Frame>

<Tabs>
  <Tab title="app.module.ts">
    ```ts theme={null}
    import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from "@angular/core";
    import { BrowserModule } from "@angular/platform-browser";
    import { AppComponent } from "./app.component";

    @NgModule({
      imports: [BrowserModule],
      declarations: [AppComponent],
      providers: [],
      bootstrap: [AppComponent],
      schemas: [CUSTOM_ELEMENTS_SCHEMA],
    })
    export class AppModule {}
    ```
  </Tab>

  <Tab title="app.component.ts">
    ```ts theme={null}
    import { CometChat } from '@cometchat/chat-sdk-javascript';
    import { Component, OnInit } from '@angular/core';
    import {  CometChatThemeService, CometChatUIKit } from '@cometchat/chat-uikit-angular';
    import "@cometchat/uikit-elements";

    @Component({
      selector: 'app-root',
      templateUrl: './app.component.html',
      styleUrls: ['./app.component.css']
    })
    export class AppComponent {

      constructor(private themeService:CometChatThemeService) {
        themeService.theme.palette.setMode("light")
        themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
      }
      public messageObject!: CometChat.TextMessage;
      reactionsRequestBuilder = new CometChat.ReactionsRequestBuilder().setLimit(2);
      ngOnInit(): void {
        CometChat.getMessageDetails("messageId").then((message) => {
            this.messageObject = message;
        }).catch((error) => {
          console.error('Error fetching message details:', error);
        });
      }

      onLogin(UID?: any) {
        CometChatUIKit.login({ uid: UID }).then(
          (user) => {
            setTimeout(() => {
              window.location.reload();
            }, 1000);
          },
          (error) => {
            console.log("Login failed with exception:", { error });
          }
        );
      }
    }
    ```
  </Tab>

  <Tab title="app.component.html">
    ```html theme={null}
    <div class="fullwidth">
      <cometchat-reaction-info
        *ngIf="messageObject"
        [messageObject]="messageObject"
        [reaction]="'\ud83e\udd21'"
        [reactionsRequestBuilder]="reactionsRequestBuilder"
      ></cometchat-reaction-info>
    </div>
    ```
  </Tab>
</Tabs>

### Events

[Events](/ui-kit/angular/components-overview#events) are emitted by a `Component`. By using event you can extend existing functionality. Being global events, they can be applied in Multiple Locations and are capable of being Added or Removed.

The `Reactions Info` component does not produce any events.

## Customization

To fit your app's design requirements, you can customize the appearance of the Reaction Info component. We provide exposed methods that allow you to modify the experience and behavior according to your specific needs.

### Style

Using Style you can customize the look and feel of the component in your app, These parameters typically control elements such as the color, size, shape, and fonts used within the component.

##### 1. reactionInfoStyle

To customize the appearance, you can assign a `reactionInfoStyle` object to the `Reactions Info` component.

**Example**

In this example, we are employing the `reactionInfoStyle`.

<Tabs>
  <Tab title="app.module.ts">
    ```ts theme={null}
    import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from "@angular/core";
    import { BrowserModule } from "@angular/platform-browser";
    import { AppComponent } from "./app.component";

    @NgModule({
      imports: [BrowserModule],
      declarations: [AppComponent],
      providers: [],
      bootstrap: [AppComponent],
      schemas: [CUSTOM_ELEMENTS_SCHEMA],
    })
    export class AppModule {}
    ```
  </Tab>

  <Tab title="app.component.ts">
    ```ts theme={null}
    import { CometChat } from '@cometchat/chat-sdk-javascript';
    import { Component, OnInit } from '@angular/core';
    import {  CometChatThemeService, CometChatUIKit } from '@cometchat/chat-uikit-angular';
    import { ReactionInfoStyle } from '@cometchat/uikit-shared';
    import "@cometchat/uikit-elements";

    @Component({
      selector: 'app-root',
      templateUrl: './app.component.html',
      styleUrls: ['./app.component.css']
    })
    export class AppComponent {

      constructor(private themeService:CometChatThemeService) {
        themeService.theme.palette.setMode("light")
        themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
      }
      public messageObject!: CometChat.TextMessage;
      reactionInfoStyle = new ReactionInfoStyle({
        background:'#631aeb',
        borderRadius:'20px',
        width:'200px',
      });
      ngOnInit(): void {
        CometChat.getMessageDetails("messageId").then((message) => {
            this.messageObject = message;
        }).catch((error) => {
          console.error('Error fetching message details:', error);
        });
      }

      onLogin(UID?: any) {
        CometChatUIKit.login({ uid: UID }).then(
          (user) => {
            setTimeout(() => {
              window.location.reload();
            }, 1000);
          },
          (error) => {
            console.log("Login failed with exception:", { error });
          }
        );
      }
    }
    ```
  </Tab>

  <Tab title="app.component.html">
    ```html theme={null}
    <div class="fullwidth">
      <cometchat-reaction-info
        *ngIf="messageObject"
        [messageObject]="messageObject"
        [reaction]="'\ud83e\udd21'"
        [reactionInfoStyle]="reactionInfoStyle"
      ></cometchat-reaction-info>
    </div>
    ```
  </Tab>
</Tabs>

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/ubfBSdV1t6rmjxeA/images/8aef6909-reaction_info_style_web_screens-af0b7b30eed9aa1911c8802dca1c1b62.png?fit=max&auto=format&n=ubfBSdV1t6rmjxeA&q=85&s=a2b4dbe61ca530027bc63479be4056e5" width="3600" height="2400" data-path="images/8aef6909-reaction_info_style_web_screens-af0b7b30eed9aa1911c8802dca1c1b62.png" />
</Frame>

List of properties exposed by ReactionsInfoStyle

| Property             | Description                                         | Code                         |
| -------------------- | --------------------------------------------------- | ---------------------------- |
| **border**           | Used to set border                                  | `border?: string,`           |
| **borderRadius**     | Used to set border radius                           | `borderRadius?: string;`     |
| **background**       | Used to set background colour                       | `background?: string;`       |
| **height**           | Used to set height                                  | `height?: string;`           |
| **width**            | Used to set width                                   | `width?: string;`            |
| **reactionFontSize** | used to set the font of the reaction                | `reactionFontSize?: string;` |
| **namesFont**        | used to set the font of the names of reacted users  | `namesFont?: string;`        |
| **namesColor**       | used to set the color of the names of reacted users | `namesColor?: string;`       |
| **loadingIconTint**  | used to set the loading icon color                  | `loadingIconTint?: string;`  |
| **errorIconTint**    | used to set the error icon color                    | `errorIconTint?: string;`    |
| **reactedTextFont**  | used to set the reacted text font                   | `reactedTextFont?: string;`  |
| **reactedTextColor** | used to set the reacted text color                  | `reactedTextColor?: string;` |

***

### Functionality

These are a set of small functional customizations that allow you to fine-tune the overall experience of the component. With these, you can change text, set custom icons, and toggle the visibility of UI elements.

<Tabs>
  <Tab title="app.module.ts">
    ```ts theme={null}
    import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from "@angular/core";
    import { BrowserModule } from "@angular/platform-browser";
    import { AppComponent } from "./app.component";

    @NgModule({
      imports: [BrowserModule],
      declarations: [AppComponent],
      providers: [],
      bootstrap: [AppComponent],
      schemas: [CUSTOM_ELEMENTS_SCHEMA],
    })
    export class AppModule {}
    ```
  </Tab>

  <Tab title="app.component.ts">
    ```ts theme={null}
    import { CometChat } from '@cometchat/chat-sdk-javascript';
    import { Component, OnInit } from '@angular/core';
    import {  CometChatThemeService, CometChatUIKit } from '@cometchat/chat-uikit-angular';
    import "@cometchat/uikit-elements";

    @Component({
      selector: 'app-root',
      templateUrl: './app.component.html',
      styleUrls: ['./app.component.css']
    })
    export class AppComponent {

      constructor(private themeService:CometChatThemeService) {
        themeService.theme.palette.setMode("light")
        themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
      }
      public messageObject!: CometChat.TextMessage;
      ngOnInit(): void {
        CometChat.getMessageDetails("messageId").then((message) => {
            this.messageObject = message;
        }).catch((error) => {
          console.error('Error fetching message details:', error);
        });
      }

      onLogin(UID?: any) {
        CometChatUIKit.login({ uid: UID }).then(
          (user) => {
            setTimeout(() => {
              window.location.reload();
            }, 1000);
          },
          (error) => {
            console.log("Login failed with exception:", { error });
          }
        );
      }
    }
    ```
  </Tab>

  <Tab title="app.component.html">
    ```html theme={null}
    <div class="fullwidth">
      <cometchat-reaction-info
        *ngIf="messageObject"
        [messageObject]="messageObject"
        [loadingIconURL]="your custom icon"
        [errorIconURL]="your custom icon"
      ></cometchat-reaction-info>
    </div>
    ```
  </Tab>
</Tabs>

***

Below is a customizations list along with corresponding code snippets

| Property           | Description                         | Code                                              |
| ------------------ | ----------------------------------- | ------------------------------------------------- |
| **loadingIconURL** | used to set the custom loading icon | `loadingIconURL="'your custom loading icon url'"` |
| **errorIconURL**   | used to set the error icon          | `errorIconURL="'your custom error icon url'"`     |
