> ## 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.

# User Details

> User Details — CometChat documentation.

## Overview

`CometChatDetails` is a component that provides additional information and settings related to a specific user.

The details screen includes the following elements and functionalities:

1. User Information: It displays details about the user. This includes his/her profile picture, name, status, and other relevant information.
2. User Actions: The details screen provides actions to block/unblock the user.

<Tabs>
  <Tab title="iOS">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/mkn0UqPQ5BXljCV1/images/95cdfa62-user_details_overview_cometchat_screens-437adbe0c280dd93de0bac5c51fc7ba2.png?fit=max&auto=format&n=mkn0UqPQ5BXljCV1&q=85&s=7fc971369bdb8caff11441193fc49166" alt="Image" width="4498" height="3120" data-path="images/95cdfa62-user_details_overview_cometchat_screens-437adbe0c280dd93de0bac5c51fc7ba2.png" />
  </Tab>

  <Tab title="Android">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/mq8rEbFfi0JjKmkM/images/684f149c-user_details_overview_cometchat_screens-3394f824950ea96a162af2c3475aefcc.png?fit=max&auto=format&n=mq8rEbFfi0JjKmkM&q=85&s=91f19de3af64757b1f4f935ffc60b6dc" alt="Image" width="4498" height="3120" data-path="images/684f149c-user_details_overview_cometchat_screens-3394f824950ea96a162af2c3475aefcc.png" />
  </Tab>
</Tabs>

## Usage

### Integration

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import { CometChatUsersWithMessages } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [chatUser, setChatUser] = React.useState<CometChat.User>();

      React.useEffect(() => {
        CometChat.getUser("uid").then((user) => {
          setChatUser(user);
        });
      }, []);

      return (
        <>{chatUser && <CometChatDetails user={chatUser}></CometChatDetails>}</>
      );
    }
    ```
  </Tab>
</Tabs>

### Actions

[Actions](/ui-kit/react-native/v4/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.

##### 1. onBack

The `onBack` event is typically triggered when the back button is clicked and it does not carry a default action.

With the following code snippet, you can effortlessly override this default operation.

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import { CometChatDetails } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const onBackHandler = () => {
        //code
      };

      return (
        <>
          {chatUser && (
            <CometChatDetails
              user={chatUser}
              onBack={onBackHandler}
            ></CometChatDetails>
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

##### 2. onError

This action doesn't change the behavior of the component but rather listens for any errors that occur in the Details component.

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import { CometChatDetails } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const onErrorHandler = (error: CometChat.CometChatException) => {
        //code
      };

      return (
        <>
          {chatUser && (
            <CometChatDetails
              user={chatUser}
              onError={onErrorHandler}
            ></CometChatDetails>
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

### 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.

`CometChatDetails` component does not have available filters.

### Events

[Events](/ui-kit/react-native/v4/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 list of `User Related Events` emitted by the Details component is as follows:

| Event               | Description                                                               |
| ------------------- | ------------------------------------------------------------------------- |
| **ccUserBlocked**   | This event is triggered when the user successfully blocks another user.   |
| **ccUserUnblocked** | This event is triggered when the user successfully unblocks another user. |

<Tabs>
  <Tab title="Adding Listeners">
    ```tsx theme={null}
    import { CometChatUIEventHandler } from "@cometchat/chat-uikit-react-native";

    CometChatUIEventHandler.addUserListener("USER_LISTENER_ID", {
      ccUserBlocked: ({ item }) => {
        //code
      },
    });

    CometChatUIEventHandler.addUserListener("USER_LISTENER_ID", {
      ccUserUnblocked: ({ item }) => {
        //code
      },
    });
    ```
  </Tab>
</Tabs>

***

<Tabs>
  <Tab title="Removing Listeners">
    ```tsx theme={null}
    import { CometChatUIEventHandler } from "@cometchat/chat-uikit-react-native";

    CometChatUIEventHandler.removeUserListener("USER_LISTENER_ID");
    ```
  </Tab>
</Tabs>

***

## Customization

To fit your app's design requirements, you can customize the appearance of the details 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. Details Style

You can set the `DetailsStyle` to the User Details Component to customize the styling.

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}

    import { CometChat } from '@cometchat/chat-sdk-react-native';
    import { CometChatMessageList, DetailsStyleInterface } from '@cometchat/chat-uikit-react-native';

    function App(): React.JSX.Element {
        const [chatUser, setChatUser] = React.useState<CometChat.User| undefined>();

        React.useEffect(() => {
            CometChat.getUser("uid").then((user) => {
                setChatUser(user);
            })
        }, []);

        const detailsStyle : DetailsStyleInterface = {
           width: '100',
           height: '1000',
           backgroundColor: '#ddd7f7',
           titleColor: "red",
           closeIconTint: "red",
        }


        return (
         <>
             { chatUser && <CometChatDetails
                  user={chatUser}
                  detailsStyle={detailsStyle}
               />
              }
         </>
       );
    }
    ```
  </Tab>
</Tabs>

<Tabs>
  <Tab title="iOS">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/XgQ9DxAoWn0btB5m/images/5bcae8ad-user_details_style_cometchat_screens-987134811b462ca796467c54517a4316.png?fit=max&auto=format&n=XgQ9DxAoWn0btB5m&q=85&s=5f1d649b8206ad4594ba3ae6174a06a1" alt="Image" width="4498" height="3120" data-path="images/5bcae8ad-user_details_style_cometchat_screens-987134811b462ca796467c54517a4316.png" />
  </Tab>

  <Tab title="Android">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/k0f_g7UwNe_JINeP/images/45193c89-user_details_style_cometchat_screens-3b8e1e7da311a00966e2bd1924ea21c1.png?fit=max&auto=format&n=k0f_g7UwNe_JINeP&q=85&s=4cb07e87d189165231d385b6f7fc27aa" alt="Image" width="4498" height="3120" data-path="images/45193c89-user_details_style_cometchat_screens-3b8e1e7da311a00966e2bd1924ea21c1.png" />
  </Tab>
</Tabs>

List of properties exposed by DetailsStyle

| Property              | Description                                                                  | Code                              |
| --------------------- | ---------------------------------------------------------------------------- | --------------------------------- |
| **height**            | Used to set height                                                           | `height?: string;`                |
| **width**             | Used to set width                                                            | `width?: string;`                 |
| **backgroundColor**   | Used to set background colour                                                | `backgroundColor?: string;`       |
| **border**            | Used to set border                                                           | `border?: BorderStyleInterface,`  |
| **borderRadius**      | Used to set border radius                                                    | `borderRadius?: string;`          |
| **titleFont**         | Used to customise the font of the title in the app bar                       | `titleFont?: FontStyleInterface;` |
| **titleColor**        | Used to customise the color of the title in the app bar                      | `titleColor?: string;`            |
| **backIconTint**      | Sets the color of the back icon of the component                             | `backIconTint?: string;`          |
| **closeIconTint**     | Sets the color of the close icon of the component                            | `closeIconTint?: string;`         |
| **onlineStatusColor** | Sets the color of the status indicator representing the user's online status | `onlineStatusColor?: string;`     |

##### 2. StatusIndicator Style

To apply customized styles to the `StatusIndicator` component in the `Details` Component, you can use the following code snippet. For further insights on `StatusIndicator` Styles [refer](/ui-kit/react-native/v4/status-indicator)

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from '@cometchat/chat-sdk-react-native';
    import { CometChatMessageList, StatusIndicatorStyleInterface } from '@cometchat/chat-uikit-react-native';

    function App(): React.JSX.Element {
        const [chatUser, setChatUser] = React.useState<CometChat.User| undefined>();

        React.useEffect(() => {
            CometChat.getUser("uid").then((user) => {
                setChatUser(user);
            })
        }, []);

        const statusIndicatorStyle: StatusIndicatorStyleInterface = {
           backgroundColor: 'grey',
        };


        return (
         <>
             { chatUser && <CometChatDetails
                  user={chatUser}
                  statusIndicatorStyle={statusIndicatorStyle}
               />
              }
         </>
       );
    }
    ```
  </Tab>
</Tabs>

##### 3. ListItem Style

To apply customized styles to the List Item component in the Details Component, you can use the following code snippet. For further insights on List Item Styles [refer](/ui-kit/react-native/v4/list-item)

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}

    import { CometChat } from '@cometchat/chat-sdk-react-native';
    import { CometChatMessageList, ListItemStyleInterface } from '@cometchat/chat-uikit-react-native';

    function App(): React.JSX.Element {
        const [chatUser, setChatUser] = React.useState<CometChat.User| undefined>();

        React.useEffect(() => {
            CometChat.getUser("uid").then((user) => {
                setChatUser(user);
            })
        }, []);

        const listItemStyle: ListItemStyleInterface = {
           backgroundColor: '#ddd7f7',
        };

        return (
         <>
             { chatUser && <CometChatDetails
                  user={chatUser}
                  listItemStyle={listItemStyle}
               />
              }
         </>
       );
    }
    ```
  </Tab>
</Tabs>

##### 4. Avatar Style

To apply customized styles to the `Avatar` component in the `Conversations` Component, you can use the following code snippet. For further insights on `Avatar` Styles [refer](/ui-kit/react-native/v4/avatar)

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}

    import { CometChat } from '@cometchat/chat-sdk-react-native';
    import { CometChatMessageList, BorderStyleInterface, AvatarStyleInterface } from '@cometchat/chat-uikit-react-native';

    function App(): React.JSX.Element {
        const [chatUser, setChatUser] = React.useState<CometChat.User| undefined>();

        React.useEffect(() => {
            CometChat.getUser("uid").then((user) => {
                setChatUser(user);
            })
        }, []);

        const borderStyle : BorderStyleInterface =  {
           borderWidth: 1,
           borderStyle: 'solid',
           borderColor: 'red',
        }

        const avatarStyle : AvatarStyleInterface = {
          border: borderStyle
        }


        return (
         <>
             { chatUser && <CometChatDetails
                  user={chatUser}
                  avatarStyle={avatarStyle}
               />
              }
         </>
       );
    }
    ```
  </Tab>
</Tabs>

***

### 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.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import {
      CometChatUsers,
      CometChatListStylesInterface,
    } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [chatUser, setChatUser] = React.useState<CometChat.User | undefined>();

      React.useEffect(() => {
        CometChat.getUser("uid").then((user) => {
          setChatUser(user);
        });
      }, []);

      return (
        <>
          {chatUser && (
            <CometChatDetails
              user={chatUser}
              title="User Details"
              showCloseButton={false}
            />
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

<Tabs>
  <Tab title="iOS">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/OOBJyP9hM0C-rAe_/images/df3f2057-details_function_1_cometchat_screens-837a0783a4978b2a24efaf90e8c0edaa.png?fit=max&auto=format&n=OOBJyP9hM0C-rAe_&q=85&s=c1b90e10e9e9d55ccbfdab975e84ef27" alt="Image" width="4498" height="3120" data-path="images/df3f2057-details_function_1_cometchat_screens-837a0783a4978b2a24efaf90e8c0edaa.png" />
  </Tab>

  <Tab title="Android">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/G6Puyz_3Zlaowa9R/images/c861288c-details_function_1_cometchat_screens-37664ef0c941b8754b453a5feb67df45.png?fit=max&auto=format&n=G6Puyz_3Zlaowa9R&q=85&s=69d28215049e0ee688e9ad9b6c621699" alt="Image" width="4498" height="3120" data-path="images/c861288c-details_function_1_cometchat_screens-37664ef0c941b8754b453a5feb67df45.png" />
  </Tab>
</Tabs>

Below is a list of customizations along with corresponding code snippets

| Property                 | Description                                                                             | Code                                                                                                       |
| ------------------------ | --------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| **user**                 | Used to set the user <Tooltip tip="Not available">🛑</Tooltip>                          | `user: CometChat.User;`                                                                                    |
| **title**                | Used to set title in the app bar                                                        | `title?: string;`                                                                                          |
| **showCloseButton**      | Used to toggle visibility for back button                                               | `showCloseButton?: boolean`                                                                                |
| **closeButtonIcon**      | Used to override the default close/back icon                                            | `closeButtonIcon?: ImageURISource`                                                                         |
| **hideProfile**          | Used to hide user profile view                                                          | `hideProfile?: boolean;`                                                                                   |
| **disableUsersPresence** | Used to control visibility of user indicator shown if user is online                    | `disableUsersPresence?: boolean`                                                                           |
| **searchBoxIcon**        | Used to set search Icon in the search field                                             | `searchBoxIcon?: ImageURISource`                                                                           |
| **hideSearch**           | Used to toggle visibility for search box                                                | `hideSearch?: boolean`                                                                                     |
| **hideError**            | Used to hide error on fetching users                                                    | `hideError?: boolean`                                                                                      |
| **hideSeparator**        | Used to hide the divider separating the user items                                      | `hideSeparator?: boolean`                                                                                  |
| **emptyStateText**       | Used to set a custom text response when fetching the users has returned an empty list   | `emptyStateText?: string`                                                                                  |
| **errorStateText**       | Used to set a custom text response when some error occurs on fetching the list of users | `errorStateText?: string`                                                                                  |
| **data**                 | Used to pass custom details template                                                    | `data?: ({user, group,}: {user?: CometChat.User;group?: CometChat.Group;}) => CometChatDetailsTemplate[];` |

***

### Advanced

For advanced-level customization, you can set custom views to the component. This lets you tailor each aspect of the component to fit your exact needs and application aesthetics. You can create and define your views, layouts, and UI elements and then incorporate those into the component.

***

#### SubtitleView

Using this prop, you can assign a custom `SubtitleView` to the Details Component.

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import {
      CometChatUsers,
      CometChatListStylesInterface,
    } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [chatUser, setChatUser] = React.useState<CometChat.User | undefined>();

      React.useEffect(() => {
        CometChat.getUser("uid").then((user) => {
          setChatUser(user);
        });
      }, []);

      const getSubtitleView = ({
        user,
        group,
      }: {
        user?: CometChat.User | undefined;
        group?: CometChat.Group | undefined;
      }) => {
        return (
          <Text
            style={{
              fontSize: 12,
              color: theme.palette.getAccent800(),
            }}
          >
            Last Active At:{" "}
            {user?.getLastActiveAt() ? formatTime(user?.getLastActiveAt()) : "--"}
          </Text>
        );
      };

      return (
        <>
          {chatUser && (
            <CometChatDetails user={chatUser} SubtitleView={getSubtitleView} />
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

<Tabs>
  <Tab title="iOS">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/19qJLi95IaEk2j9s/images/fe947626-user_details_subtitle_view_cometchat_screens-4641c2021ec4d345ba03f745154b5805.png?fit=max&auto=format&n=19qJLi95IaEk2j9s&q=85&s=9a3d67b14989cb5f52fd499ae4a83d11" alt="Image" width="4498" height="3120" data-path="images/fe947626-user_details_subtitle_view_cometchat_screens-4641c2021ec4d345ba03f745154b5805.png" />
  </Tab>

  <Tab title="Android">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/TO10Bmu50bb5qPTI/images/324fe9b0-user_details_subtitle_view_cometchat_screens-6cc1693918ce059d1f2804461ad07830.png?fit=max&auto=format&n=TO10Bmu50bb5qPTI&q=85&s=1b44f0fe99da5536d9b15a9a6a6a0c41" alt="Image" width="4498" height="3120" data-path="images/324fe9b0-user_details_subtitle_view_cometchat_screens-6cc1693918ce059d1f2804461ad07830.png" />
  </Tab>
</Tabs>

#### CustomProfileView

Using this prop, you can assign a `Custom ProfileView` to the Details Component.

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import {
      CometChatUsers,
      CometChatListStylesInterface,
    } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [chatUser, setChatUser] = React.useState<CometChat.User | undefined>();

      React.useEffect(() => {
        CometChat.getUser("uid").then((user) => {
          setChatUser(user);
        });
      }, []);

      const customProfileViewStyle: StyleProp<ViewStyle> = {
        flexDirection: "row",
        alignItems: "flex-start",
        padding: 10,
        marginRight: 15,
        borderColor: "black",
        borderWidth: 1,
        backgroundColor: "#E8EAE9",
        borderRadius: 10,
        margin: 2,
      };

      const getCustomProfileView = ({
        user,
        group,
      }: {
        user?: CometChat.User;
        group?: CometChat.Group;
      }) => {
        return (
          <View style={customProfileViewStyle}>
            <CometChatAvatar
              image={user?.getAvatar() ? { uri: user.getAvatar() } : undefined}
              name={user?.getName()}
            />

            <View>
              <Text style={{ color: "black", fontWeight: "bold" }}>
                {user?.getName()}
              </Text>
              <Text style={{ color: "#667" }}>{user?.getStatus()}</Text>
            </View>
          </View>
        );
      };

      return (
        <>
          {chatUser && (
            <CometChatDetails
              user={chatUser}
              CustomProfileView={getCustomProfileView}
            />
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

<Tabs>
  <Tab title="iOS">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/21UBnagXOw-XG0Sv/images/ab8a774a-user_details_custom_profile_view_cometchat_screens-ec7fd8819338c6d8257398b49359b44f.png?fit=max&auto=format&n=21UBnagXOw-XG0Sv&q=85&s=83c8b221d17e97ff787ad6a469bd7106" alt="Image" width="4498" height="3120" data-path="images/ab8a774a-user_details_custom_profile_view_cometchat_screens-ec7fd8819338c6d8257398b49359b44f.png" />
  </Tab>

  <Tab title="Android">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/JSRiWiPGBHsJZFCg/images/9a7ecb94-user_details_custom_profile_view_cometchat_screens-a9913dfde05c7a55461a44dfeecba6c7.png?fit=max&auto=format&n=JSRiWiPGBHsJZFCg&q=85&s=ce729b9c7deed3bf0d8010035424180a" alt="Image" width="4498" height="3120" data-path="images/9a7ecb94-user_details_custom_profile_view_cometchat_screens-a9913dfde05c7a55461a44dfeecba6c7.png" />
  </Tab>
</Tabs>

#### DetailsTemplate

The `CometChatDetailsTemplate` offers a structure for organizing information in the CometChat details component. It serves as a blueprint, defining how user-related details are presented. This structure allows for customization and organization within the CometChat interface.

This defines the structure of template data for the details component.

| Name                      | Type                       | Description                                                                              |
| ------------------------- | -------------------------- | ---------------------------------------------------------------------------------------- |
| **id**                    | `string` \| `number`       | Identifier for the template option                                                       |
| **title**                 | `string`                   | Heading text for the template option                                                     |
| **titleColor**            | `string`                   | User-defined UI component to customise the trailing view for each option in a template.  |
| **titleFont**             | `FontStyleInterface`       | User-defined UI component to override the default view for the option.                   |
| **titleStyle**            | `TextStyle`                | Function invoked when user clicks on the option.                                         |
| **sectionSeparatorColor** | `string`                   | Sets all the different properties of font for the title text                             |
| **itemSeparatorColor**    | `string`                   | Sets the foreground colour of title text                                                 |
| **hideSectionSeparator**  | `boolean`                  | Image url for the icon to symbolise an option                                            |
| **hideItemSeparator**     | `boolean`                  | Color applied to the icon of the option                                                  |
| **options**               | `CometChatDetailsOption[]` | Sets the [`CometChatDetailsOption`](/ui-kit/react-native/v4/user-details#detailsoption)s |

#### DetailsOption

The `DetailsOption` defines the structure for individual options within the CometChat details component, facilitating customization and functionality for user interactions.

This defines the structure of each option for a template in the details component.

| Property            | Type                                                      | Description                                                  |
| ------------------- | --------------------------------------------------------- | ------------------------------------------------------------ |
| **id**              | `string` \| `number`                                      | Identifier for the template                                  |
| **title**           | `string`                                                  | Heading text for the template                                |
| **titleStyle**      | `TextStyle`                                               | Sets the title style                                         |
| **icon**            | `ImageType`                                               | Sets all the different properties of font for the title text |
| **iconTint**        | `string`                                                  | Sets the icon tint\`                                         |
| **backgroundColor** | `string`                                                  | Sets the background color                                    |
| **CustomView**      | `() => JSX.Element`                                       | Sets custom view for the option                              |
| **Tail**            | `() => JSX.Element`                                       | Sets the tail view for the option                            |
| **height**          | `number`                                                  | Sets the height                                              |
| **onClick**         | `({ user, group }: { user?: any; group?: any }) => void;` | Sets the onClick Handler for the option                      |

Below is an example of using Custom Details templates:

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import {
      CometChatUsers,
      CometChatListStylesInterface,
    } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [chatUser, setChatUser] = React.useState<CometChat.User | undefined>();

      React.useEffect(() => {
        CometChat.getUser("uid").then((user) => {
          setChatUser(user);
        });
      }, []);

      const getTemplate = ({
        user,
        group,
      }: {
        user?: CometChat.User;
        group?: CometChat.Group;
      }): CometChatDetailsTemplate[] => {
        const blockOption: CometChatDetailsOption = {
          id: "block",
          title: "Block User",
          onClick: ({
            user,
            group,
          }: {
            user?: CometChat.User;
            group?: CometChat.group;
          }) => {
            //code
          },
        };

        const reportOption: CometChatDetailsOption = {
          id: "report",
          title: "Report User",
          onClick: ({
            user,
            group,
          }: {
            user?: CometChat.User;
            group?: CometChat.group;
          }) => {
            //code
          },
        };

        const detailsTemplate: CometChatDetailsTemplate = {
          id: "Block",
          title: "Block/Report",
          titleColor: "red",
          sectionSeparatorColor: "grey",
          itemSeparatorColor: "#6851D6",
          hideItemSeparator: false,
          options: [blockOption, reportOption],
        };

        return [detailsTemplate];
      };

      return (
        <>{chatUser && <CometChatDetails user={chatUser} data={getTemplate} />}</>
      );
    }
    ```
  </Tab>
</Tabs>

<Tabs>
  <Tab title="iOS">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/OOBJyP9hM0C-rAe_/images/ded7571b-details_template_cometchat_screens-fa99b505459a561efde4f8bff03e9e5c.png?fit=max&auto=format&n=OOBJyP9hM0C-rAe_&q=85&s=4ef281c4deae73c8ccccbc64184443cf" alt="Image" width="4498" height="3120" data-path="images/ded7571b-details_template_cometchat_screens-fa99b505459a561efde4f8bff03e9e5c.png" />
  </Tab>

  <Tab title="Android">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/2JiXkJ8lq6PmPGlJ/images/712777d1-details_template_cometchat_screens-318b0b655736829647d68d2940c6c7a5.png?fit=max&auto=format&n=2JiXkJ8lq6PmPGlJ&q=85&s=795a2192b25b12c8edb4bade95236106" alt="Image" width="4498" height="3120" data-path="images/712777d1-details_template_cometchat_screens-318b0b655736829647d68d2940c6c7a5.png" />
  </Tab>
</Tabs>

***
