Skip to contentSkip to content

ChatMessageGroup API

API reference docs for the React ChatMessageGroup component. Learn about the props, CSS, and other APIs of this exported module.

Demos

Import

import { ChatMessageGroup } from '@mui/x-chat/ChatMessage';
// or
import { ChatMessageGroup } from '@mui/x-chat';

Learn about the difference by reading this guide on minimizing bundle size.

Props

Props of the native component are also available.

NameTypeDefaultDescription
groupKeyfunc(message) => message.author?.id ?? message.role ?? ''

A function that maps a message to a group key. Messages that resolve to the same key are visually grouped (shared avatar, author name, etc.). Use createTimeWindowGroupKey(windowMs) to replicate time-window-based grouping.

The component cannot hold a ref.

Source code

If you did not find the information in this page, consider having a look at the implementation of the component for more detail.