Skip to contentSkip to content

ChatMessageList API

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

Demos

Import

import { ChatMessageList } from '@mui/x-chat/ChatMessageList';
// or
import { ChatMessageList } 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
autoScroll{ buffer?: number }
| bool
true

Controls automatic scrolling to the bottom when new messages arrive or streaming content grows, as long as the user is within buffer pixels of the bottom.

  • true – enable with the default buffer (150 px).
  • { buffer: number } – enable with a custom threshold.
  • false – disable (the scroll-to-bottom affordance is still available).

Scrolling when the user sends a message is always active.

The component cannot hold a ref.

CSS classes

These class names are useful for styling with CSS. They are applied to the component's slots when specific states are triggered.

Class nameRule nameDescription
.MuiChatMessageList-contentcontentStyles applied to the message list content element.
.MuiChatMessageList-rootrootStyles applied to the message list root element.
.MuiChatMessageList-scrollerscrollerStyles applied to the message list scroller element.

You can override the style of the component using one of these customization options:

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.