Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
353746f
[docs] Reorganize existing chat docs navigation
hasdfa May 17, 2026
153c262
[chat-headless] Add createEchoAdapter and createAiSdkAdapter
hasdfa May 13, 2026
2f156eb
[x-chat] Complete built-in adapter exports
hasdfa May 17, 2026
59f5389
[chat-headless] Format AI SDK adapter test
hasdfa May 17, 2026
849b199
[x-chat] Address built-in adapter review comments
hasdfa May 18, 2026
8d32a61
[x-chat] Fix adapter CI issues
hasdfa May 18, 2026
2e92b22
[chat-headless] Harden runtime model and message errors
hasdfa May 17, 2026
216a7da
[chat-headless] Fix runtime branch CI
hasdfa May 17, 2026
c8fc6ba
[chat-headless] Keep runtime tests on pre-slots API
hasdfa May 18, 2026
9034463
[chat-headless] Fix runtime static docs output
hasdfa May 18, 2026
212b1cc
[chat-headless] Address runtime review comments
hasdfa May 18, 2026
0585a84
[chat-headless] Fix provider controlled message reset
hasdfa May 18, 2026
555b9fa
[chat-headless] Forward role display names
hasdfa May 18, 2026
738f10e
Merge branch 'master' into x-chat-docs-ia-existing-content
hasdfa May 18, 2026
2d10846
[chat-headless] Regenerate ChatBox API docs
hasdfa May 18, 2026
285865c
[x-chat] Harden material message surfaces
hasdfa May 17, 2026
2f6463d
[x-chat] Fix material message surfaces CI
hasdfa May 17, 2026
66c6e5a
[x-chat] Fix message surface API docs generation
hasdfa May 18, 2026
613840a
[docs] Dedupe chat API imports
hasdfa May 18, 2026
7d4443f
[docs] Address chat nav review suggestions
hasdfa May 20, 2026
bcd8b46
Merge branch 'master' into x-chat-docs-ia-existing-content
hasdfa May 20, 2026
cdaf1cb
Merge branch 'master' into x-chat-headless-runtime-model
hasdfa May 20, 2026
1648d70
Merge branch 'master' into x-chat-headless-runtime-model
hasdfa May 20, 2026
696e9be
Merge branch 'master' into x-chat-docs-ia-existing-content
hasdfa May 26, 2026
a48abf7
[docs] Align chat display nav group path
hasdfa May 26, 2026
81ab35f
Merge branch 'master' into x-chat-headless-runtime-model
hasdfa May 26, 2026
aee4621
[chat-headless] Address runtime model review comments
hasdfa May 26, 2026
59ea6ab
Merge branch 'master' into x-chat-docs-ia-existing-content
hasdfa May 27, 2026
2a6984b
Merge branch 'master' into x-chat-docs-ia-existing-content
hasdfa May 27, 2026
ebeccbd
Merge remote-tracking branch 'upstream/master' into x-chat-headless-r…
hasdfa May 27, 2026
557d583
Merge remote-tracking branch 'upstream/master' into x-chat-material-m…
hasdfa May 27, 2026
25959cd
Update messageReasoningLabel from 'Thoughts' to 'Reasoning'
hasdfa May 27, 2026
e35f0ee
[docs] Fix controlled composer demo width
hasdfa May 27, 2026
b906a95
fix tests
hasdfa May 27, 2026
0cd3365
fix tests
hasdfa May 27, 2026
71abd6b
[docs] Fix controlled composer demo width
hasdfa May 27, 2026
65b335c
Merge remote-tracking branch 'origin/x-chat-docs-ia-existing-content'…
hasdfa May 27, 2026
0696106
Merge remote-tracking branch 'origin/x-chat-headless-runtime-model' i…
hasdfa May 28, 2026
712e696
Merge branch 'master' into x-chat-material-message-surfaces
hasdfa Jun 2, 2026
2ce51bb
Merge branch 'master' into x-chat-material-message-surfaces
hasdfa Jun 2, 2026
8dc6572
Merge branch 'master' into x-chat-material-message-surfaces
hasdfa Jun 2, 2026
5d1d0c6
Merge remote-tracking branch 'upstream/master' into x-chat-material-m…
Copilot Jun 2, 2026
4258a05
Merge master into copilot/x-chat-material-message-surfaces-reopen
Copilot Jun 2, 2026
ed6de9a
Merge branch 'master' into copilot/hasdfamui-xcopilotx-chat-material-…
hasdfa Jun 2, 2026
b59eebd
[x-chat] Address review feedback on Material message surfaces
hasdfa Jun 2, 2026
5435ba0
[x-chat] Use an effect to auto-open the tool input section
hasdfa Jun 2, 2026
fe84f39
[x-chat] Restore the default conversation-list sidebar width
hasdfa Jun 2, 2026
dcc0fed
Merge branch 'master' into copilot/hasdfamui-xcopilotx-chat-material-…
hasdfa Jun 3, 2026
12da38f
Merge branch 'master' into copilot/hasdfamui-xcopilotx-chat-material-…
hasdfa Jun 3, 2026
8d27d9b
Merge branch 'master' into copilot/hasdfamui-xcopilotx-chat-material-…
hasdfa Jun 3, 2026
dc4e741
Merge branch 'master' into copilot/hasdfamui-xcopilotx-chat-material-…
hasdfa Jun 3, 2026
ff63f5f
[x-chat] Add ChatBox layout slots and migration codemod
hasdfa May 17, 2026
2a1a018
[x-chat] Fix slots migration branch CI
hasdfa May 17, 2026
538f9c1
[x-chat] Regenerate slots API demo links
hasdfa May 18, 2026
49fbc15
[x-chat] Address chat slots codemod reviews
hasdfa May 18, 2026
1b10d00
[x-chat] Keep flat ChatBox slots, distribute via context, drop codemod
hasdfa Jun 4, 2026
a7efa46
[x-chat] Fix root-slot fallback being clobbered by undefined override
hasdfa May 20, 2026
5ba532a
[x-chat] Render slot tree alongside injected author in compact ChatMe…
hasdfa May 20, 2026
729e5aa
Merge branch 'master' into x-chat-chatbox-layout-slots-codemod
hasdfa Jun 5, 2026
cc3a95c
[docs] Commit missing chat demo .tsx.preview files
hasdfa Jun 5, 2026
2451846
[x-chat] Run ChatBox conversation-list width test browser-only
hasdfa Jun 5, 2026
d45cfa8
[x-chat] Address slot review nits: spread order + flat test names
hasdfa Jun 5, 2026
ac93ec7
[x-chat] Document ChatBox slots and tidy innerRef typing
hasdfa Jun 5, 2026
6796a27
[x-chat] Group rendered-list rows correctly and drop dead sidebar hide
hasdfa Jun 5, 2026
6c68452
[docs] Flatten leftover nested slot vocab in Agent/Messenger overview…
hasdfa Jun 5, 2026
e6a6866
[x-chat] Address slots reviews: messageGroup wrapper, compact childre…
hasdfa Jun 5, 2026
6db1d21
[x-chat] Drop redundant classes prop from ChatMessage slot sub-parts
hasdfa Jun 5, 2026
1997fd0
[x-chat] Forward consumer onToggle on tool sections without clobberin…
hasdfa Jun 5, 2026
d3c37af
[x-chat] Stop groupAuthorName leaking to the DOM on headless MessageRoot
hasdfa Jun 5, 2026
dbb93bd
[x-chat] Fix standalone attachment list and function-form suggestions…
hasdfa Jun 5, 2026
6a53730
[x-chat] Fix emptyState slotProps callback, header-hidden back nav, c…
hasdfa Jun 5, 2026
512a0ff
[x-chat] Support callback-form slotProps everywhere + render row divi…
hasdfa Jun 5, 2026
758238a
[x-chat] Allow null for dateDivider/unreadMarker slots to hide them
hasdfa Jun 5, 2026
d596389
[x-chat] Close the narrow conversation overlay on keyboard selection
hasdfa Jun 5, 2026
1dd458d
[x-chat] Forward messageGroup.groupKey to MessageGroup; drop stray cl…
hasdfa Jun 6, 2026
c2c0a0c
[x-chat] Make ChatBox slots.messageList a true wrapper-only root slot
hasdfa Jun 6, 2026
f02a39f
[x-chat] Assign the split conversation list to the conversations pane
hasdfa Jun 6, 2026
0193799
[x-chat] Preserve top-level suggestions sx in the above-composer path
hasdfa Jun 6, 2026
f21c0e6
[docs] Add chat docs page shells
hasdfa May 17, 2026
a35144d
[docs] Fix chat page shell Vale wording
hasdfa May 17, 2026
8af6019
[docs] Regenerate chat page shell API links
hasdfa May 18, 2026
fa61a10
[docs] Add chat playground infrastructure
hasdfa May 17, 2026
f886f3b
[docs] Fix chat playground default exports
hasdfa May 17, 2026
4c55a69
[docs] Move chat playground helpers out of docs data
hasdfa May 18, 2026
24a2a9d
[docs] Keep chat playground helpers as typed source only
hasdfa May 18, 2026
0c00546
[docs] Flatten ChatBox slot keys in playground registry
hasdfa Jun 4, 2026
96c3984
[docs] Update chat quickstart and backend adapters
hasdfa May 17, 2026
fd09b8d
[docs] Fix chat quickstart backend static output
hasdfa May 18, 2026
f00e2d4
[docs] Fix chat quickstart links
hasdfa May 18, 2026
093a805
[docs] Use AI SDK v5 convertToModelMessages in the ai-sdk-adapter rou…
hasdfa Jun 5, 2026
4d3649c
[docs] Update chat basics display and behavior
hasdfa May 17, 2026
b965528
[docs] Fix composer demo shell default export
hasdfa May 18, 2026
3643701
[docs] Fix chat basics display static output
hasdfa May 18, 2026
96adddd
[docs] Point chat basics playgrounds at shared helpers
hasdfa May 18, 2026
372bc8d
[docs] Regenerate chat basics playground output
hasdfa May 18, 2026
16ed289
[docs] Format chat basics playground sources
hasdfa May 18, 2026
5e1ca9d
[docs] Fix chat streaming self link
hasdfa May 18, 2026
2373f00
[docs] Regenerate chat basics API demos
hasdfa May 18, 2026
e1d8147
[docs] Update chat customization core material and headless docs
hasdfa May 17, 2026
d26d598
[docs] Fix chat customization static output
hasdfa May 18, 2026
8159632
[docs] Point chat customization playgrounds at shared helpers
hasdfa May 18, 2026
3c0f447
[docs] Format chat tool approval playground
hasdfa May 18, 2026
71407b4
[docs] Fix chat tool approval link
hasdfa May 18, 2026
5cfac59
[docs] Fix chat tool approval adapter link
hasdfa May 18, 2026
e85108a
[docs] Regenerate chat customization API demos
hasdfa May 18, 2026
c96cb57
[docs] Flatten customization slot vocabulary to match ChatBox flat API
hasdfa Jun 4, 2026
2fef3d7
[docs] Update chat overview and component gallery
hasdfa May 17, 2026
d122493
[docs] Fix chat overview static output
hasdfa May 18, 2026
93779a0
[docs] Keep chat gallery links branch-local
hasdfa May 18, 2026
860bacb
[docs] Regenerate chat overview API demos
hasdfa May 18, 2026
715e69b
[docs] Add Basic tab to chat overview playground
hasdfa May 20, 2026
4dea997
[docs] Fix chat playground dark mode
hasdfa Jun 2, 2026
a6e8261
[docs] Flatten ChatBox slot vocabulary in overview demos
hasdfa Jun 4, 2026
bd49bce
Merge branch 'master' into x-chat-docs-overview-gallery
hasdfa Jun 6, 2026
cd469d3
[docs] Parse playground sx without executing it
hasdfa Jun 6, 2026
a41aaa0
[docs] Format chat overview playground demos with Prettier
hasdfa Jun 6, 2026
ba653b0
[docs] Regenerate chat-box API demos list
hasdfa Jun 6, 2026
e995417
[docs] Collapse the Basic example's playground card by default
hasdfa Jun 6, 2026
4b272bf
[x-chat] Render the unread marker as a centered chip with divider rules
hasdfa Jun 6, 2026
ab076cc
Fix x-chat review findings
hasdfa Jun 6, 2026
e5976ce
[x-chat] Reset mounted ref on remount in useCopyToClipboard
hasdfa Jun 6, 2026
3eab9e2
[x-chat] Use theme.alpha for the message error card background
hasdfa Jun 6, 2026
5cffa72
[x-chat] Fix code review findings
hasdfa Jun 6, 2026
c460964
[docs] Fix chat playground review findings
hasdfa Jun 6, 2026
fa3067f
Stop tracking thoughts/ review notes
hasdfa Jun 6, 2026
026ce9a
Merge upstream/master into x-chat-docs-overview-gallery
hasdfa Jun 6, 2026
6066bce
Fix CI lint and prettier failures
hasdfa Jun 6, 2026
553c790
[x-chat] Fix review findings in slot props, clipboard, and message error
hasdfa Jun 7, 2026
0afe566
[x-chat] Replace hand-rolled markdown parser with markdown-to-jsx
hasdfa Jun 7, 2026
5801817
[x-chat] Apply prettier formatting
hasdfa Jun 7, 2026
bb94de2
[x-chat] Address code review findings
hasdfa Jun 8, 2026
e419cb1
Merge branch 'master' into x-chat-docs-overview-gallery
hasdfa Jun 8, 2026
e84869a
fix copy
hasdfa Jun 8, 2026
58d4804
Merge branch 'x-chat-docs-overview-gallery' of github.com:hasdfa/mui-…
hasdfa Jun 8, 2026
30e210c
[x-chat] Fix CI: stale API docs + flaky streaming-markdown tests
hasdfa Jun 8, 2026
8e3cbc8
Merge branch 'master' into x-chat-docs-overview-gallery
hasdfa Jun 10, 2026
45e96e1
[x-chat] Add roving focus to message list with Enter drill-in
hasdfa Jun 10, 2026
cee543f
[x-chat] Add landmarks, drawer ARIA, and streaming announcer
hasdfa Jun 10, 2026
903427c
[x-chat] Add a11y test suites for roving focus, drill-in, landmarks
hasdfa Jun 10, 2026
8523a27
[x-chat] Document the keyboard navigation and a11y model
hasdfa Jun 10, 2026
e7ee14d
[x-chat] Harden drill-in against stale actionable state
hasdfa Jun 10, 2026
afe18a6
Merge branch 'master' into x-chat-docs-overview-gallery
hasdfa Jun 10, 2026
3e8fd4e
[docs] Remove stale KeyboardNavigation demo preview
hasdfa Jun 10, 2026
0817ee3
[docs] Fix broken chat adapter link (realtime-events 404)
hasdfa Jun 11, 2026
9e643ab
[x-chat] Fix broken union-type escaping in docs API tables
hasdfa Jun 11, 2026
4b6d74e
[x-chat] Add runtime APIs: regenerate, typing signal, onReachBottom, …
hasdfa Jun 11, 2026
d0080ed
[x-chat] Add docs-correctness guard; fix import/frontmatter violations
hasdfa Jun 11, 2026
581a4dc
[x-chat] Execute API-dependent docs page plans (wave 3)
hasdfa Jun 11, 2026
c5e28aa
[x-chat] Execute remaining docs page plans (wave 4)
hasdfa Jun 11, 2026
deee90c
[x-chat] Add Item to the headless ConversationList namespace
hasdfa Jun 11, 2026
5657846
[x-chat] Fix AI SDK adapter merging sequential replies into one message
hasdfa Jun 12, 2026
ac01d66
[x-chat] Fix CI: doc table alignment, broken links, stale demo preview
hasdfa Jun 12, 2026
fbce3a4
[x-chat] Fix CI: error-codes drift and remaining broken links
hasdfa Jun 12, 2026
22a5ad9
Merge branch 'master' into x-chat-docs-overview-gallery
hasdfa Jun 12, 2026
2d7bcad
[x-chat] Mint a unique fallback assistant id per run in the runtime
hasdfa Jun 12, 2026
3b7c42a
[x-chat] Add streaming indicator feature
hasdfa Jun 12, 2026
ab581e4
[x-chat] Add configurable default expanded state for tool cards
hasdfa Jun 12, 2026
0781c19
Merge remote-tracking branch 'upstream/master' into x-chat-docs-overv…
hasdfa Jun 12, 2026
8ee8218
[x-chat] Hide empty gallery sections and add search empty state
hasdfa Jun 12, 2026
80fb8c6
fixes
hasdfa Jun 12, 2026
72675e3
[x-chat] Add waiting-phase streaming indicator row
hasdfa Jun 12, 2026
f75d296
Merge remote-tracking branch 'upstream/master' into x-chat-docs-overv…
hasdfa Jun 12, 2026
847b89c
[docs] Regenerate ToolCardExpansionPlayground demo JS
hasdfa Jun 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
85 changes: 85 additions & 0 deletions docs/data/chat/accessibility/accessibility.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
productId: x-chat
title: Accessibility
packageName: '@mui/x-chat'
githubLabel: 'scope: chat'
---

# Chat - Accessibility

<p class="description">Learn how MUI X Chat implements keyboard navigation, landmarks, and screen reader announcements.</p>

## Keyboard navigation

The message list is a single Tab stop: a roving tabindex over the `role="article"` messages keeps only one message in the tab order at a time, so tabbing from the composer to the rest of the application never walks through every message.

{{"demo": "../material/message-list/KeyboardNavigation.js", "defaultCodeOpen": false, "bg": "inline"}}

| Key | Action |
| :----------------------------------------------- | :----------------------------------------------------------------------------------------------- |
| <kbd>Tab</kbd> / <kbd>Shift</kbd>+<kbd>Tab</kbd> | Enter or leave the message list (a single stop) |
| <kbd>Arrow Up</kbd> / <kbd>Arrow Down</kbd> | Move focus to the previous / next message |
| <kbd>Home</kbd> / <kbd>End</kbd> | Move focus to the first / latest message |
| <kbd>Page Up</kbd> / <kbd>Page Down</kbd> | Native scrolling (kept unbound so a message taller than the viewport stays readable by keyboard) |
| <kbd>Enter</kbd> | Drill into the focused message's controls (links, copy buttons, tool output, actions) |
| <kbd>Escape</kbd> | Return from a message's controls to the message |

Before the user interacts, the tab stop tracks the newest message.
The tab stop is remembered per list, so leaving and re-entering the message list returns focus to the same message.

## Drill-in lifecycle

Interactive content inside messages—links in Markdown, code-block copy buttons, tool and reasoning disclosures, source and file links—stays out of the tab order until the user drills into the focused message with <kbd>Enter</kbd>, and leaves it again on <kbd>Escape</kbd>.
All controls remain mouse-clickable throughout.
Message actions are additionally hidden (`visibility: hidden`) until the message is hovered or drilled into.

When the user drills back out with <kbd>Escape</kbd>, focus returns to the message that owned the controls. Because the tab stop is remembered per list, re-entering the list later restores focus to the same message.

## Landmarks

The chat surface exposes labeled landmarks so assistive technology can jump between its regions:

- The thread is a `role="region"` labeled by the `threadLandmarkLabel` locale key.
- The composer is a labeled `form` (the `composerLandmarkLabel` locale key).
- The conversation list is a `role="navigation"` region labeled by `conversationListLandmarkLabel`.
- On small screens, the conversation list opens in a `role="dialog"` with `aria-modal="true"`.

## Screen reader announcements

- The scroller element has `role="log"` and `aria-live="polite"`, so newly arriving complete messages are announced.
- A streaming message carries `aria-busy="true"` while it streams, hinting assistive technology to defer reading it until it completes.
- A visually hidden `role="status"` region announces streaming transitions—"Assistant is responding" and "Response complete"—exactly once each, never per streamed token.
- Each message is a `role="article"` labeled "Message from {author}".
- Date dividers use `role="separator"`.

The announcement strings and labels come from the locale text system, so they localize with the rest of the UI: `messageListLabel` for the list, `responseStreamingStartedAnnouncement` and `responseStreamingCompletedAnnouncement` for the streaming announcer, and `threadLandmarkLabel`, `composerLandmarkLabel`, and `conversationListLandmarkLabel` for the landmarks.

## Reduced motion

The loading skeleton's shimmer animation pauses automatically when the user requests reduced motion (`prefers-reduced-motion: reduce`).
The skeleton itself is decorative and sets no ARIA, so you wire the loading state up explicitly—see [Loading and empty states](/x/react-chat/display/loading-and-empty-states/) for the `aria-busy` and `role="status"` pattern.

## Opting out and custom controls

Set `enableRovingFocus={false}` on the message list to opt out entirely, for example when rendering fully custom rows that manage focus themselves.

Custom interactive content rendered inside a message can participate in the drill-in model with the `useMessageContentTabIndex()` hook (or `useMessageActionable()` for full control), both available from `@mui/x-chat/headless`:

```tsx
function CustomControl() {
const tabIndex = useMessageContentTabIndex();
return (
<button type="button" tabIndex={tabIndex}>
…
</button>
);
}
```

Outside a roving message list both hooks leave the natural tab order untouched, so the same component works in standalone message compositions.

## See also

- [Message list—Accessibility](/x/react-chat/material/message-list/#accessibility) for the message-list keyboard table and drill-in specifics.
- [Messages](/x/react-chat/basics/messages/#accessibility) for the summary alongside the message API.
- [Conversation list—Accessibility notes](/x/react-chat/multi-conversation/conversation-list/#accessibility-notes) for the sidebar's roving listbox.
163 changes: 163 additions & 0 deletions docs/data/chat/ai-and-agents/reasoning/ReasoningSlotsDemo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
'use client';
import * as React from 'react';
import { ChatBox } from '@mui/x-chat';

import AutoAwesomeOutlinedIcon from '@mui/icons-material/AutoAwesomeOutlined';

const CONVERSATION_ID = 'reasoning-slots-demo';

const initialConversations = [{ id: CONVERSATION_ID, title: 'Reasoning slots' }];

const initialMessages = [
{
id: 'seed',
conversationId: CONVERSATION_ID,
role: 'assistant',
status: 'sent',
parts: [
{
type: 'reasoning',
text: 'The user greeted me. A short, friendly reply is enough — no tools needed.',
state: 'done',
},
{
type: 'text',
text: 'Hi! Send a message to see the restyled reasoning disclosure stream.',
},
],
},
];

// Emit one chunk per pull, with a small delay, so the disclosure visibly streams.
function streamChunks(chunks) {
let index = 0;
return new ReadableStream({
pull(controller) {
return new Promise((resolve) => {
setTimeout(() => {
if (index < chunks.length) {
controller.enqueue(chunks[index]);
index += 1;
} else {
controller.close();
}
resolve();
}, 100);
});
},
});
}

const adapter = {
async sendMessage({ message }) {
const messageId = `reply-${message.id}`;
return streamChunks([
{ type: 'start', messageId },
{ type: 'reasoning-start', id: 'r1' },
{
type: 'reasoning-delta',
id: 'r1',
delta: 'Let me think about how to answer this. ',
},
{
type: 'reasoning-delta',
id: 'r1',
delta: 'The question is straightforward, ',
},
{ type: 'reasoning-delta', id: 'r1', delta: 'so a concise reply works best.' },
{ type: 'reasoning-end', id: 'r1' },
{ type: 'text-start', id: 't1' },
{ type: 'text-delta', id: 't1', delta: 'Here is the answer, now that ' },
{ type: 'text-delta', id: 't1', delta: 'the reasoning above has finished.' },
{ type: 'text-end', id: 't1' },
{ type: 'finish', messageId },
]);
},
};

// Custom `root` slot — a tinted disclosure container.
const CustomRoot = React.forwardRef(function CustomRoot(props, ref) {
const { ownerState, style, ...other } = props;
return (
<details
ref={ref}
style={{
margin: '6px 0',
padding: '6px 10px',
borderRadius: 8,
background: 'rgba(99, 102, 241, 0.08)',
...style,
}}
{...other}
/>
);
});

// Custom `summary` slot — uses `ownerState.streaming` for a live affordance.
const CustomSummary = React.forwardRef(function CustomSummary(props, ref) {
const { ownerState, children, style, ...other } = props;
const streaming = ownerState?.streaming;
return (
<summary
ref={ref}
style={{
cursor: 'pointer',
display: 'flex',
alignItems: 'center',
gap: 6,
listStyle: 'none',
fontSize: 13,
fontWeight: 500,
color: '#6366f1',
...style,
}}
{...other}
>
<AutoAwesomeOutlinedIcon style={{ fontSize: 14 }} />
{children}
{streaming ? (
<span
aria-hidden
style={{
width: 6,
height: 6,
borderRadius: '50%',
background: '#6366f1',
animation: 'reasoning-pulse 1s ease-in-out infinite',
}}
/>
) : null}
<style>
{
'@keyframes reasoning-pulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }'
}
</style>
</summary>
);
});

export default function ReasoningSlotsDemo() {
return (
<ChatBox
adapter={adapter}
initialActiveConversationId={CONVERSATION_ID}
initialConversations={initialConversations}
initialMessages={initialMessages}
slotProps={{
messageContent: {
partProps: {
reasoning: {
slots: { root: CustomRoot, summary: CustomSummary },
},
},
},
}}
sx={{
height: 480,
border: '1px solid',
borderColor: 'divider',
borderRadius: 1,
}}
/>
);
}
Loading
Loading