Skip to contentSkip to content

ChatMessageAuthorLabel API

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

Demos

Import

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

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

Props

NameTypeDescription
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
.Mui-errorApplied when the message has an error status
.MuiChatMessageAuthorLabel-actionsactionsStyles applied to the message actions element.
.MuiChatMessageAuthorLabel-authorLabelauthorLabelStyles applied to the message author label element.
.MuiChatMessageAuthorLabel-avataravatarStyles applied to the message avatar element.
.MuiChatMessageAuthorLabel-bubblebubbleStyles applied to the message bubble element inside content.
.MuiChatMessageAuthorLabel-contentcontentStyles applied to the message content element.
.MuiChatMessageAuthorLabel-dateDividerdateDividerStyles applied to the date divider element.
.MuiChatMessageAuthorLabel-groupgroupStyles applied to the message group element.
.MuiChatMessageAuthorLabel-groupAuthorNamegroupAuthorNameClass applied to the group author name element.
.MuiChatMessageAuthorLabel-groupTimestampgroupTimestampClass applied to the group timestamp element (compact variant only).
.MuiChatMessageAuthorLabel-inlineMetainlineMetaStyles applied to the inline meta container element (default variant).
.MuiChatMessageAuthorLabel-inlineMetaSpacerinlineMetaSpacerStyles applied to the inline meta spacer element (default variant).
.MuiChatMessageAuthorLabel-metametaStyles applied to the message meta element.
.MuiChatMessageAuthorLabel-roleAssistantroleAssistantApplied when the message role is 'assistant'
.MuiChatMessageAuthorLabel-roleUserroleUserApplied when the message role is 'user'
.MuiChatMessageAuthorLabel-rootrootStyles applied to the message root element.
.MuiChatMessageAuthorLabel-streamingstreamingApplied while the message is streaming

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.