[object Promise]

# ChatBox API

## Demos

For examples and details on the usage of this React component, visit the component demo pages:

- [Chat - Building an adapter](/x/react-chat/backend/building-an-adapter/)
- [Chat - Controlled state](/x/react-chat/backend/controlled-state/)
- [Chat - ChatBox](/x/react-chat/basics/chatbox/)
- [Chat - Variants and density](/x/react-chat/basics/variants-and-density/)
- [Chat - Error handling](/x/react-chat/behavior/error-handling/)
- [Chat - Streaming](/x/react-chat/behavior/streaming/)
- [Chat - Look and feel](/x/react-chat/customization/look-and-feel/)
- [Chat - Customization overview](/x/react-chat/customization/overview/)
- [Chat - Structure](/x/react-chat/customization/structure/)
- [Chat - Customization](/x/react-chat/material/customization/)
- [Chat - Slot overrides](/x/react-chat/material/slot-overrides/)
- [Chat - Real-time sync](/x/react-chat/multi-conversation/real-time-sync/)
- [MUI X Chat](/x/react-chat/)
- [Chat - Quickstart](/x/react-chat/quickstart/)
- [Chat - Events and callbacks](/x/react-chat/resources/events-and-callbacks/)
- [Chat - Performance](/x/react-chat/resources/performance/)

## Import

```jsx
import { ChatBox } from '@mui/x-chat/ChatBox';
// or
import { ChatBox } from '@mui/x-chat';
```

## Props

| Name | Type | Default | Required | Description |
|------|------|---------|----------|-------------|
| adapter | `{ addToolApprovalResponse?: func, listConversations?: func, listMessages?: func, loadMore?: func, markRead?: func, reconnectToStream?: func, regenerate?: func, sendMessage: func, setTyping?: func, stop?: func, subscribe?: func }` | - | Yes |  |
| activeConversationId | `string` | - | No |  |
| children | `node` | - | No |  |
| classes | `object` | - | No | Override or extend the styles applied to the component. |
| composerValue | `string` | - | No |  |
| conversations | `Array<{ avatarUrl?: string, id: string, lastMessageAt?: string, metadata?: object, participants?: Array<{ avatarUrl?: string, displayName?: string, id: string, isOnline?: bool, metadata?: object, role?: 'assistant' \| 'system' \| 'user' }>, readState?: 'read' \| 'unread', subtitle?: string, title?: string, unreadCount?: number }>` | - | No |  |
| currentUser | `{ avatarUrl?: string, displayName?: string, id: string, isOnline?: bool, metadata?: object, role?: 'assistant' \| 'system' \| 'user' }` | - | No |  |
| density | `'comfortable' \| 'compact' \| 'standard'` | `'standard'` | No |  |
| features | `{ attachments?: { acceptedMimeTypes?: Array<string>, maxFileCount?: number, maxFileSize?: number, onAttachmentReject?: func } \| bool, autoScroll?: { buffer?: number } \| bool, conversationHeader?: bool, conversationList?: bool, dateDivider?: bool, helperText?: bool, scrollToBottom?: bool, streamingIndicator?: 'auto' \| bool, suggestions?: bool, typingSignal?: bool, unreadMarker?: bool }` | - | No |  |
| getMessageAuthorAvatarUrl | `func` | `(message) => message.author?.avatarUrl` | No |  |
| getMessageAuthorDisplayName | `func` | `(message) => message.author?.displayName` | No |  |
| getMessageAuthorId | `func` | `(message) => message.author?.id` | No |  |
| initialActiveConversationId | `string` | - | No |  |
| initialComposerValue | `string` | - | No |  |
| initialConversations | `Array<{ avatarUrl?: string, id: string, lastMessageAt?: string, metadata?: object, participants?: Array<{ avatarUrl?: string, displayName?: string, id: string, isOnline?: bool, metadata?: object, role?: 'assistant' \| 'system' \| 'user' }>, readState?: 'read' \| 'unread', subtitle?: string, title?: string, unreadCount?: number }>` | - | No |  |
| initialMessages | `Array<{ author?: { avatarUrl?: string, displayName?: string, id: string, isOnline?: bool, metadata?: object, role?: 'assistant' \| 'system' \| 'user' }, conversationId?: string, createdAt?: string, editedAt?: string, id: string, metadata?: object, parts: Array<{ data: any, id?: string, transient?: bool, type: object } \| { filename?: string, mediaType: string, type: 'file', url: string } \| { sourceId: string, text?: string, title?: string, type: 'source-document' } \| { sourceId: string, title?: string, type: 'source-url', url: string } \| { state?: 'done' \| 'streaming', text: string, type: 'reasoning' } \| { state?: 'done' \| 'streaming', text: string, type: 'text' } \| { toolInvocation: { approval?: object, approvalId?: string, callProviderMetadata?: object, errorText?: string, input?: any, output?: any, preliminary?: bool, providerExecuted?: bool, state: 'approval-requested' \| 'approval-responded' \| 'input-available' \| 'input-streaming' \| 'output-available' \| 'output-denied' \| 'output-error', title?: string, toolCallId: string, toolName: string }, type: 'dynamic-tool' } \| { toolInvocation: { approval?: object, approvalId?: string, callProviderMetadata?: object, errorText?: string, input?: any, output?: any, preliminary?: bool, providerExecuted?: bool, state: 'approval-requested' \| 'approval-responded' \| 'input-available' \| 'input-streaming' \| 'output-available' \| 'output-denied' \| 'output-error', title?: string, toolCallId: string, toolName: string }, type: 'tool' } \| { type: 'step-start' }>, role: 'assistant' \| 'system' \| 'user', status?: 'cancelled' \| 'error' \| 'pending' \| 'read' \| 'sending' \| 'sent' \| 'streaming', updatedAt?: string }>` | - | No |  |
| layoutMode | `'overlay' \| 'split' \| 'standard'` | - | No |  |
| layoutModeBreakpoints | `{ overlay?: number, split?: number }` | - | No |  |
| localeText | `object` | - | No |  |
| members | `Array<{ avatarUrl?: string, displayName?: string, id: string, isOnline?: bool, metadata?: object, role?: 'assistant' \| 'system' \| 'user' }>` | - | No |  |
| messages | `Array<{ author?: { avatarUrl?: string, displayName?: string, id: string, isOnline?: bool, metadata?: object, role?: 'assistant' \| 'system' \| 'user' }, conversationId?: string, createdAt?: string, editedAt?: string, id: string, metadata?: object, parts: Array<{ data: any, id?: string, transient?: bool, type: object } \| { filename?: string, mediaType: string, type: 'file', url: string } \| { sourceId: string, text?: string, title?: string, type: 'source-document' } \| { sourceId: string, title?: string, type: 'source-url', url: string } \| { state?: 'done' \| 'streaming', text: string, type: 'reasoning' } \| { state?: 'done' \| 'streaming', text: string, type: 'text' } \| { toolInvocation: { approval?: object, approvalId?: string, callProviderMetadata?: object, errorText?: string, input?: any, output?: any, preliminary?: bool, providerExecuted?: bool, state: 'approval-requested' \| 'approval-responded' \| 'input-available' \| 'input-streaming' \| 'output-available' \| 'output-denied' \| 'output-error', title?: string, toolCallId: string, toolName: string }, type: 'dynamic-tool' } \| { toolInvocation: { approval?: object, approvalId?: string, callProviderMetadata?: object, errorText?: string, input?: any, output?: any, preliminary?: bool, providerExecuted?: bool, state: 'approval-requested' \| 'approval-responded' \| 'input-available' \| 'input-streaming' \| 'output-available' \| 'output-denied' \| 'output-error', title?: string, toolCallId: string, toolName: string }, type: 'tool' } \| { type: 'step-start' }>, role: 'assistant' \| 'system' \| 'user', status?: 'cancelled' \| 'error' \| 'pending' \| 'read' \| 'sending' \| 'sent' \| 'streaming', updatedAt?: string }>` | - | No |  |
| onActiveConversationChange | `function(conversationId: string \| undefined) => void` | - | No |  |
| onComposerValueChange | `function(value: string) => void` | - | No |  |
| onConversationsChange | `function(conversations: Array<ChatConversation>) => void` | - | No |  |
| onData | `function(part: ChatDataMessagePart) => void` | - | No |  |
| onError | `function(error: ChatError) => void` | - | No |  |
| onFinish | `function(payload: ChatOnFinishPayload) => void` | - | No |  |
| onMessagesChange | `function(messages: Array<ChatMessage>) => void` | - | No |  |
| onToolCall | `function(payload: ChatOnToolCallPayload) => void` | - | No |  |
| partRenderers | `{ dynamic-tool?: func, file?: func, reasoning?: func, source-document?: func, source-url?: func, step-start?: func, text?: func, tool?: func }` | - | No |  |
| roleDisplayNames | `{ assistant?: string, system?: string, user?: string }` | - | No |  |
| slotProps | `object` | - | No |  |
| slots | `object` | - | No |  |
| storeClass | `func` | `ChatStore` | No |  |
| streamFlushInterval | `number` | `16` | No |  |
| suggestions | `Array<{ label?: string, value: string } \| string>` | - | No |  |
| suggestionsAutoSubmit | `bool` | `false` | No |  |
| sx | `Array<func \| object \| bool> \| func \| object` | - | No | The system prop that allows defining system overrides as well as additional CSS styles. |
| variant | `'compact' \| 'default'` | `'default'` | No |  |

> **Note**: The `ref` is forwarded to the root element.

> Any other props supplied will be provided to the root element (native element).

## Slots

| Name | Default | Class | Description |
|------|---------|-------|-------------|
| root | `'div'` | `.MuiChatBox-root` | The outermost `ChatBox` container element. |
| layout | `'div'` | `.MuiChatBox-layout` | Wrapper that arranges the conversations pane and the thread pane. |
| conversationsPane | `'div'` | `.MuiChatBox-conversationsPane` | Container for the conversation-list sidebar (or drawer on narrow widths). |
| threadPane | `'div'` | `.MuiChatBox-threadPane` | Container for the active thread — the message list plus the composer. |
| conversationRoot | `'div'` | - | Styled root of `` (wrapper-only); the default header,
message list and composer continue to render inside it. |
| conversationList | `ChatConversationList` | - | The conversation-list sidebar component. |
| conversationHeader | `ChatConversationHeader` | - | The header bar rendered above the message list. |
| conversationHeaderInfo | `ChatConversationHeaderInfo` | - | The title + subtitle group inside the header. |
| conversationTitle | `ChatConversationTitle` | - | The conversation title element. |
| conversationSubtitle | `ChatConversationSubtitle` | - | The conversation subtitle element (participants, status, etc.). |
| conversationHeaderActions | `ChatConversationHeaderActions` | - | The actions area on the trailing side of the header. |
| messageList | `'div'` | - | Styled scrollable root element of `` (wrapper-only). The
default message rows render inside it, so a plain element such as `'section'`
wraps the list rather than replacing it. |
| dateDivider | `ChatDateDivider` | - | The date separator rendered between message groups. Only rendered when
`features.dateDivider` is enabled. Pass `null` to hide it. |
| unreadMarker | `ChatUnreadMarker` | - | The "new messages" marker. Only rendered when `features.unreadMarker` is
enabled. Pass `null` to hide it. |
| messageGroup | `'div'` | - | The per-author group wrapper around consecutive messages. |
| streamingIndicator | `ChatStreamingIndicator, wrapped in an assistant row with an avatar while waiting for the response to start` | - | The animated dots shown while an assistant response is in flight: as a
trailing row while waiting for the response to start, then inside the
assistant bubble while it streams. Controlled by
`features.streamingIndicator` (`'auto'` by default). Pass `null` to hide it. |
| messageRoot | `'div'` | - | Styled root of `` (wrapper-only); the default avatar/content/meta
tree still renders inside it. |
| messageAvatar | `ChatMessageAvatar` | - | Avatar component. Pass `null` to hide the avatar entirely and drop the
reserved avatar grid track. |
| messageContent | `ChatMessageContent` | - | The message bubble component. |
| messageMeta | `ChatMessageMeta` | - | External meta (compact variant). Pass `null` to hide. |
| messageInlineMeta | `ChatMessageInlineMeta` | - | Inline meta rendered inside the bubble (default variant). Pass `null` to hide. |
| messageError | `ChatMessageError` | - | Error card shown under the bubble when the message status is `error`.
Pass `null` to hide the error surface entirely (no component is mounted). |
| messageActions | `An actions row with only the `extraActions` from `slotProps.messageActions`, if any.` | - | Actions row component (receives `{ messageId }`). Pass `null` to hide
actions entirely; omit to render only the declarative `extraActions` from
`slotProps.messageActions` if provided. |
| messageAuthorName | `'div'` | - | Author name label rendered by the group wrapper (default variant: above the
bubble; compact variant: inside the message grid). Pass `null` to hide. |
| composerRoot | `'form'` | - | Styled root of `` (wrapper-only); the default attach/input/send/
toolbar render inside it. |
| composerInput | `ChatComposerTextArea` | - | The auto-resizing text input. |
| composerSendButton | `ChatComposerSendButton` | - | Send button. Pass `null` to hide it; the form still submits on Enter. |
| composerAttachButton | `ChatComposerAttachButton` | - | Attach button. Pass `null` to hide just the button while keeping the rest of
the attachment pipeline (drag/drop, paste). Use `features.attachments: false`
to disable attachments entirely. |
| composerAttachmentList | `ChatComposerAttachmentList` | - | The pending-attachment preview list. |
| composerToolbar | `ChatComposerToolbar` | - | The composer toolbar (button row). |
| composerHelperText | `ChatComposerHelperText` | - | The helper / disclaimer text below the input. |
| typingIndicator | `null` | - | The animated typing indicator shown while the assistant responds. |
| scrollToBottom | `ChatScrollToBottomAffordance` | - | The floating scroll-to-bottom button. |
| suggestions | `ChatSuggestions` | - | The prompt-suggestion chips. |
| emptyState | `The built-in empty state, or the suggestions when there are some.` | - | Custom content rendered when the thread has no messages. |

## Source code

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

- [/packages/x-chat/src/ChatBox/ChatBox.tsx](https://github.com/mui/material-ui/tree/HEAD/packages/x-chat/src/ChatBox/ChatBox.tsx)

# ChatStreamingIndicator API

## Demos

For examples and details on the usage of this React component, visit the component demo pages:

- [Chat - Streaming](/x/react-chat/behavior/streaming/)

## Import

```jsx
import { ChatStreamingIndicator } from '@mui/x-chat/ChatIndicators';
// or
import { ChatStreamingIndicator } from '@mui/x-chat';
```

## Props

| Name | Type | Default | Required | Description |
|------|------|---------|----------|-------------|
| classes | `object` | - | No | Override or extend the styles applied to the component. |
| index | `number` | - | No |  |
| items | `Array<string>` | - | No |  |
| message | `{ author?: { avatarUrl?: string, displayName?: string, id: string, isOnline?: bool, metadata?: object, role?: 'assistant' \| 'system' \| 'user' }, conversationId?: string, createdAt?: string, editedAt?: string, id: string, metadata?: object, parts: Array<{ data: any, id?: string, transient?: bool, type: object } \| { filename?: string, mediaType: string, type: 'file', url: string } \| { sourceId: string, text?: string, title?: string, type: 'source-document' } \| { sourceId: string, title?: string, type: 'source-url', url: string } \| { state?: 'done' \| 'streaming', text: string, type: 'reasoning' } \| { state?: 'done' \| 'streaming', text: string, type: 'text' } \| { toolInvocation: { approval?: object, approvalId?: string, callProviderMetadata?: object, errorText?: string, input?: any, output?: any, preliminary?: bool, providerExecuted?: bool, state: 'approval-requested' \| 'approval-responded' \| 'input-available' \| 'input-streaming' \| 'output-available' \| 'output-denied' \| 'output-error', title?: string, toolCallId: string, toolName: string }, type: 'dynamic-tool' } \| { toolInvocation: { approval?: object, approvalId?: string, callProviderMetadata?: object, errorText?: string, input?: any, output?: any, preliminary?: bool, providerExecuted?: bool, state: 'approval-requested' \| 'approval-responded' \| 'input-available' \| 'input-streaming' \| 'output-available' \| 'output-denied' \| 'output-error', title?: string, toolCallId: string, toolName: string }, type: 'tool' } \| { type: 'step-start' }>, role: 'assistant' \| 'system' \| 'user', status?: 'cancelled' \| 'error' \| 'pending' \| 'read' \| 'sending' \| 'sent' \| 'streaming', updatedAt?: string }` | - | No |  |
| messageId | `string` | - | No |  |
| mode | `'auto' \| bool` | `'auto'` | No |  |
| slotProps | `object` | `{}` | No |  |
| slots | `object` | `{}` | No |  |
| sx | `Array<func \| object \| bool> \| func \| object` | - | No | The system prop that allows defining system overrides as well as additional CSS styles. |

> **Note**: The `ref` is forwarded to the root element.

> Any other props supplied will be provided to the root element (native element).

## Slots

| Name | Default | Class | Description |
|------|---------|-------|-------------|
| root | `'div'` | `.MuiChatStreamingIndicator-root` | The component that renders the root. |

## CSS

### Rule name

| Global class | Rule name | Description |
|--------------|-----------|-------------|
| - | bubble | Styles applied to the waiting-phase typing bubble. |
| - | row | Styles applied to the waiting-phase assistant row wrapper. |

## Source code

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

- [/packages/x-chat/src/ChatIndicators/ChatStreamingIndicator.tsx](https://github.com/mui/material-ui/tree/HEAD/packages/x-chat/src/ChatIndicators/ChatStreamingIndicator.tsx)