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.
| Name | Type | Description |
|---|
The component cannot hold a ref.
These class names are useful for styling with CSS. They are applied to the component's slots when specific states are triggered.
| Class name | Rule name | Description |
|---|---|---|
| .Mui-error | Applied when the message has an error status | |
| .MuiChatMessageAuthorLabel-actions | actions | Styles applied to the message actions element. |
| .MuiChatMessageAuthorLabel-authorLabel | authorLabel | Styles applied to the message author label element. |
| .MuiChatMessageAuthorLabel-avatar | avatar | Styles applied to the message avatar element. |
| .MuiChatMessageAuthorLabel-bubble | bubble | Styles applied to the message bubble element inside content. |
| .MuiChatMessageAuthorLabel-content | content | Styles applied to the message content element. |
| .MuiChatMessageAuthorLabel-dateDivider | dateDivider | Styles applied to the date divider element. |
| .MuiChatMessageAuthorLabel-group | group | Styles applied to the message group element. |
| .MuiChatMessageAuthorLabel-groupAuthorName | groupAuthorName | Class applied to the group author name element. |
| .MuiChatMessageAuthorLabel-groupTimestamp | groupTimestamp | Class applied to the group timestamp element (compact variant only). |
| .MuiChatMessageAuthorLabel-inlineMeta | inlineMeta | Styles applied to the inline meta container element (default variant). |
| .MuiChatMessageAuthorLabel-inlineMetaSpacer | inlineMetaSpacer | Styles applied to the inline meta spacer element (default variant). |
| .MuiChatMessageAuthorLabel-meta | meta | Styles applied to the message meta element. |
| .MuiChatMessageAuthorLabel-roleAssistant | roleAssistant | Applied when the message role is 'assistant' |
| .MuiChatMessageAuthorLabel-roleUser | roleUser | Applied when the message role is 'user' |
| .MuiChatMessageAuthorLabel-root | root | Styles applied to the message root element. |
| .MuiChatMessageAuthorLabel-streaming | streaming | Applied while the message is streaming |
You can override the style of the component using one of these customization options:
- With a global class name.
- With a rule name as part of the component's
styleOverridesproperty in a custom theme.
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.