@assistant-ui/mcp-docs-server 0.1.23 → 0.1.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/.docs/organized/code-examples/waterfall.md +5 -3
  2. package/.docs/organized/code-examples/with-a2a.md +676 -0
  3. package/.docs/organized/code-examples/with-ag-ui.md +7 -8
  4. package/.docs/organized/code-examples/with-ai-sdk-v6.md +28 -16
  5. package/.docs/organized/code-examples/with-artifacts.md +5 -5
  6. package/.docs/organized/code-examples/with-assistant-transport.md +3 -3
  7. package/.docs/organized/code-examples/with-chain-of-thought.md +34 -26
  8. package/.docs/organized/code-examples/with-cloud-standalone.md +10 -8
  9. package/.docs/organized/code-examples/with-cloud.md +5 -5
  10. package/.docs/organized/code-examples/with-custom-thread-list.md +7 -7
  11. package/.docs/organized/code-examples/with-elevenlabs-scribe.md +8 -8
  12. package/.docs/organized/code-examples/with-expo.md +571 -539
  13. package/.docs/organized/code-examples/with-external-store.md +3 -4
  14. package/.docs/organized/code-examples/with-ffmpeg.md +5 -5
  15. package/.docs/organized/code-examples/with-google-adk.md +353 -0
  16. package/.docs/organized/code-examples/with-heat-graph.md +304 -0
  17. package/.docs/organized/code-examples/with-langgraph.md +25 -23
  18. package/.docs/organized/code-examples/with-parent-id-grouping.md +4 -4
  19. package/.docs/organized/code-examples/with-react-hook-form.md +6 -9
  20. package/.docs/organized/code-examples/with-react-ink.md +265 -0
  21. package/.docs/organized/code-examples/with-react-router.md +10 -11
  22. package/.docs/organized/code-examples/with-store.md +29 -18
  23. package/.docs/organized/code-examples/with-tanstack.md +7 -7
  24. package/.docs/organized/code-examples/with-tap-runtime.md +6 -4
  25. package/.docs/raw/blog/2025-01-31-changelog/index.mdx +1 -1
  26. package/.docs/raw/blog/2026-03-launch-week/index.mdx +227 -0
  27. package/.docs/raw/docs/(docs)/architecture.mdx +1 -1
  28. package/.docs/raw/docs/(docs)/cli.mdx +14 -9
  29. package/.docs/raw/docs/(docs)/copilots/make-assistant-tool-ui.mdx +8 -3
  30. package/.docs/raw/docs/(docs)/copilots/make-assistant-tool.mdx +5 -1
  31. package/.docs/raw/docs/(docs)/copilots/{make-assistant-readable.mdx → make-assistant-visible.mdx} +14 -5
  32. package/.docs/raw/docs/(docs)/copilots/model-context.mdx +11 -11
  33. package/.docs/raw/docs/(docs)/copilots/motivation.mdx +2 -2
  34. package/.docs/raw/docs/(docs)/devtools.mdx +3 -2
  35. package/.docs/raw/docs/(docs)/guides/attachments.mdx +9 -11
  36. package/.docs/raw/docs/(docs)/guides/branching.mdx +11 -6
  37. package/.docs/raw/docs/(docs)/guides/chain-of-thought.mdx +18 -16
  38. package/.docs/raw/docs/(docs)/guides/context-api.mdx +81 -43
  39. package/.docs/raw/docs/(docs)/guides/dictation.mdx +5 -5
  40. package/.docs/raw/docs/(docs)/guides/editing.mdx +16 -7
  41. package/.docs/raw/docs/(docs)/guides/latex.mdx +3 -0
  42. package/.docs/raw/docs/(docs)/guides/message-timing.mdx +2 -1
  43. package/.docs/raw/docs/(docs)/guides/multi-agent.mdx +173 -0
  44. package/.docs/raw/docs/(docs)/guides/quoting.mdx +55 -206
  45. package/.docs/raw/docs/(docs)/guides/speech.mdx +1 -4
  46. package/.docs/raw/docs/(docs)/guides/suggestions.mdx +9 -15
  47. package/.docs/raw/docs/(docs)/guides/tool-ui.mdx +17 -7
  48. package/.docs/raw/docs/(docs)/guides/tools.mdx +24 -9
  49. package/.docs/raw/docs/(docs)/index.mdx +3 -3
  50. package/.docs/raw/docs/(docs)/installation.mdx +69 -46
  51. package/.docs/raw/docs/(reference)/api-reference/context-providers/text-message-part-provider.mdx +20 -6
  52. package/.docs/raw/docs/(reference)/api-reference/integrations/react-data-stream.mdx +24 -4
  53. package/.docs/raw/docs/(reference)/api-reference/integrations/react-hook-form.mdx +1 -1
  54. package/.docs/raw/docs/(reference)/api-reference/integrations/vercel-ai-sdk.mdx +20 -19
  55. package/.docs/raw/docs/(reference)/api-reference/overview.mdx +28 -53
  56. package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar.mdx +4 -4
  57. package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-modal.mdx +7 -1
  58. package/.docs/raw/docs/(reference)/api-reference/primitives/attachment.mdx +20 -14
  59. package/.docs/raw/docs/(reference)/api-reference/primitives/branch-picker.mdx +1 -1
  60. package/.docs/raw/docs/(reference)/api-reference/primitives/composer.mdx +99 -45
  61. package/.docs/raw/docs/(reference)/api-reference/primitives/message-part.mdx +52 -40
  62. package/.docs/raw/docs/(reference)/api-reference/primitives/message.mdx +343 -23
  63. package/.docs/raw/docs/(reference)/api-reference/primitives/suggestion.mdx +4 -6
  64. package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list-item.mdx +4 -2
  65. package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list.mdx +3 -5
  66. package/.docs/raw/docs/(reference)/api-reference/primitives/thread.mdx +169 -22
  67. package/.docs/raw/docs/(reference)/api-reference/runtimes/assistant-runtime.mdx +14 -4
  68. package/.docs/raw/docs/(reference)/api-reference/runtimes/attachment-runtime.mdx +15 -26
  69. package/.docs/raw/docs/(reference)/api-reference/runtimes/composer-runtime.mdx +39 -21
  70. package/.docs/raw/docs/(reference)/api-reference/runtimes/message-part-runtime.mdx +33 -9
  71. package/.docs/raw/docs/(reference)/api-reference/runtimes/message-runtime.mdx +48 -21
  72. package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-list-item-runtime.mdx +36 -7
  73. package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-list-runtime.mdx +30 -10
  74. package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-runtime.mdx +12 -10
  75. package/.docs/raw/docs/(reference)/migrations/deprecation-policy.mdx +1 -1
  76. package/.docs/raw/docs/(reference)/migrations/react-langgraph-v0-7.mdx +9 -4
  77. package/.docs/raw/docs/(reference)/migrations/v0-11.mdx +7 -5
  78. package/.docs/raw/docs/(reference)/migrations/v0-12.mdx +9 -7
  79. package/.docs/raw/docs/(reference)/migrations/v0-14.mdx +159 -0
  80. package/.docs/raw/docs/(reference)/react-compatibility.mdx +5 -134
  81. package/.docs/raw/docs/cloud/ai-sdk-assistant-ui.mdx +89 -7
  82. package/.docs/raw/docs/cloud/ai-sdk.mdx +19 -5
  83. package/.docs/raw/docs/cloud/langgraph.mdx +13 -3
  84. package/.docs/raw/docs/ink/adapters.mdx +41 -0
  85. package/.docs/raw/docs/ink/custom-backend.mdx +203 -0
  86. package/.docs/raw/docs/ink/hooks.mdx +448 -0
  87. package/.docs/raw/docs/ink/index.mdx +239 -0
  88. package/.docs/raw/docs/ink/migration.mdx +140 -0
  89. package/.docs/raw/docs/ink/primitives.mdx +699 -0
  90. package/.docs/raw/docs/react-native/adapters.mdx +63 -87
  91. package/.docs/raw/docs/react-native/custom-backend.mdx +11 -14
  92. package/.docs/raw/docs/react-native/hooks.mdx +214 -232
  93. package/.docs/raw/docs/react-native/index.mdx +118 -159
  94. package/.docs/raw/docs/react-native/migration.mdx +144 -0
  95. package/.docs/raw/docs/react-native/primitives.mdx +431 -302
  96. package/.docs/raw/docs/runtimes/a2a/index.mdx +294 -0
  97. package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +9 -9
  98. package/.docs/raw/docs/runtimes/ai-sdk/v5-legacy.mdx +14 -3
  99. package/.docs/raw/docs/runtimes/ai-sdk/v6.mdx +53 -0
  100. package/.docs/raw/docs/runtimes/assistant-transport.mdx +59 -25
  101. package/.docs/raw/docs/runtimes/custom/custom-thread-list.mdx +13 -6
  102. package/.docs/raw/docs/runtimes/custom/external-store.mdx +138 -38
  103. package/.docs/raw/docs/runtimes/custom/local.mdx +184 -42
  104. package/.docs/raw/docs/runtimes/data-stream.mdx +92 -19
  105. package/.docs/raw/docs/runtimes/google-adk/index.mdx +624 -0
  106. package/.docs/raw/docs/runtimes/helicone.mdx +6 -6
  107. package/.docs/raw/docs/runtimes/langgraph/index.mdx +38 -27
  108. package/.docs/raw/docs/runtimes/langgraph/tutorial/introduction.mdx +1 -1
  109. package/.docs/raw/docs/runtimes/langgraph/tutorial/part-1.mdx +15 -20
  110. package/.docs/raw/docs/runtimes/langgraph/tutorial/part-2.mdx +7 -11
  111. package/.docs/raw/docs/runtimes/langgraph/tutorial/part-3.mdx +8 -11
  112. package/.docs/raw/docs/runtimes/langserve.mdx +6 -7
  113. package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +18 -3
  114. package/.docs/raw/docs/ui/context-display.mdx +147 -0
  115. package/.docs/raw/docs/ui/file.mdx +5 -4
  116. package/.docs/raw/docs/ui/image.mdx +5 -4
  117. package/.docs/raw/docs/ui/markdown.mdx +3 -1
  118. package/.docs/raw/docs/ui/model-selector.mdx +8 -8
  119. package/.docs/raw/docs/ui/part-grouping.mdx +7 -10
  120. package/.docs/raw/docs/ui/quote.mdx +210 -0
  121. package/.docs/raw/docs/ui/reasoning.mdx +12 -11
  122. package/.docs/raw/docs/ui/sources.mdx +88 -17
  123. package/.docs/raw/docs/ui/streamdown.mdx +16 -7
  124. package/.docs/raw/docs/ui/thread-list.mdx +11 -13
  125. package/.docs/raw/docs/ui/thread.mdx +28 -33
  126. package/.docs/raw/docs/ui/tool-fallback.mdx +5 -6
  127. package/.docs/raw/docs/ui/tool-group.mdx +9 -8
  128. package/.docs/raw/docs/utilities/heat-graph.mdx +236 -0
  129. package/.docs/raw/docs/utilities/tw-shimmer.mdx +211 -0
  130. package/package.json +4 -4
  131. package/.docs/raw/docs/(reference)/legacy/styled/assistant-modal.mdx +0 -77
  132. package/.docs/raw/docs/(reference)/legacy/styled/decomposition.mdx +0 -635
  133. package/.docs/raw/docs/(reference)/legacy/styled/markdown.mdx +0 -77
  134. package/.docs/raw/docs/(reference)/legacy/styled/scrollbar.mdx +0 -72
  135. package/.docs/raw/docs/(reference)/legacy/styled/thread-width.mdx +0 -22
  136. package/.docs/raw/docs/(reference)/legacy/styled/thread.mdx +0 -77
  137. /package/.docs/raw/docs/cloud/{overview.mdx → index.mdx} +0 -0
@@ -1,635 +0,0 @@
1
- ---
2
- title: Decomposition
3
- description: Break down styled components into smaller customizable parts.
4
- ---
5
-
6
- ## Overview
7
-
8
- The Styled Components can be decomposed into smaller components. At each level, you can swap out a specific component with your own custom component.
9
-
10
- ## Thread
11
-
12
- Renders an entire conversation thread.
13
-
14
- ```tsx
15
- import {
16
- Thread,
17
- ThreadWelcome,
18
- Composer,
19
- type ThreadConfig,
20
- } from "@assistant-ui/react-ui";
21
-
22
- const MyThread: FC<ThreadConfig> = (config) => {
23
- return (
24
- <Thread.Root config={config}>
25
- <Thread.Viewport>
26
- <ThreadWelcome />
27
- <Thread.Messages />
28
- <Thread.FollowupSuggestions />
29
- <Thread.ViewportFooter>
30
- <Thread.ScrollToBottom />
31
- <Composer />
32
- </Thread.ViewportFooter>
33
- </Thread.Viewport>
34
- </Thread.Root>
35
- );
36
- };
37
- ```
38
-
39
- **Usage:**
40
-
41
- ```ts
42
- <MyThread />
43
- ```
44
-
45
- ### Thread.Root
46
-
47
- Contains all parts of the thread. Accepts a `config` prop which is used by many other styled components.
48
-
49
- ### Thread.Viewport
50
-
51
- The scrollable area containing all messages. Anchors scroll to the bottom as new messages are added.
52
-
53
- ### Thread.Messages
54
-
55
- Renders all messages. This renders a separate component for each message (passed to the `components` prop).
56
-
57
- ### Thread.ViewportFooter
58
-
59
- Renders the footer of the thread viewport. This is the sticky footer that does not scroll with the messages.
60
-
61
- ### Thread.ScrollToBottom
62
-
63
- A button to scroll the viewport to the bottom. Hidden when the viewport is already at bottom.
64
-
65
- ## ThreadWelcome
66
-
67
- Renders the welcome message when no messages are present.
68
-
69
- ```tsx
70
- import { ThreadWelcome } from "@assistant-ui/react-ui";
71
-
72
- const MyThreadWelcome: FC = () => {
73
- return (
74
- <ThreadWelcome.Root>
75
- <ThreadWelcome.Center>
76
- <ThreadWelcome.Avatar />
77
- <ThreadWelcome.Message />
78
- </ThreadWelcome.Center>
79
- <ThreadWelcome.Suggestions />
80
- </ThreadWelcome.Root>
81
- );
82
- };
83
- ```
84
-
85
- **Usage:**
86
-
87
- Decompose `Thread` into `MyThread` and use `MyThreadWelcome` instead of `ThreadWelcome`.
88
-
89
- ```ts
90
- const MyThread: FC<ThreadConfig> = (config) => {
91
- ...
92
- <MyThreadWelcome />
93
- ...
94
- };
95
- ```
96
-
97
- ### ThreadWelcome.Root
98
-
99
- Contains all parts of the welcome message.
100
-
101
- ### ThreadWelcome.Center
102
-
103
- The centered content of the welcome message.
104
-
105
- ### ThreadWelcome.Avatar
106
-
107
- The avatar of the assistant.
108
-
109
- ### ThreadWelcome.Message
110
-
111
- The welcome message.
112
-
113
- ### ThreadWelcome.Suggestions
114
-
115
- Conversation starter suggestions.
116
-
117
- ```tsx
118
- import { ThreadWelcome } from "@assistant-ui/react-ui";
119
-
120
- const MyThreadWelcomeSuggestions: FC = () => {
121
- return (
122
- <div className="aui-thread-welcome-suggestions">
123
- <ThreadWelcome.Suggestion prompt="Write me a poem about the weather" />
124
- <ThreadWelcome.Suggestion prompt="What is assistant-ui?" />
125
- </div>
126
- );
127
- };
128
- ```
129
-
130
- ### ThreadWelcome.Suggestion
131
-
132
- A conversation starter suggestion.
133
-
134
- ## Composer
135
-
136
- Renders the composer.
137
-
138
- ```tsx
139
- import { Composer } from "@assistant-ui/react-ui";
140
-
141
- const MyComposer: FC = () => {
142
- return (
143
- <Composer.Root>
144
- <Composer.Attachments />
145
- <Composer.AddAttachment />
146
- <Composer.Input autoFocus />
147
- <Composer.Action />
148
- </Composer.Root>
149
- );
150
- };
151
- ```
152
-
153
- **Usage:**
154
-
155
- Decompose `Thread` into `MyThread` and use `MyComposer` instead of `Composer`.
156
-
157
- ```ts
158
- const MyThread: FC<ThreadConfig> = (config) => {
159
- ...
160
- <MyComposer />
161
- ...
162
- };
163
- ```
164
-
165
- ### Composer.Root
166
-
167
- Contains all parts of the composer.
168
-
169
- ### Composer.Input
170
-
171
- The text input field for the user to type a new message.
172
-
173
- ### Composer.Action
174
-
175
- The button to send or cancel the message.
176
-
177
- ```tsx
178
- import { Composer } from "@assistant-ui/react-ui";
179
- import { AuiIf } from "@assistant-ui/react";
180
-
181
- const MyComposerAction: FC = () => {
182
- return (
183
- <>
184
- <AuiIf condition={(s) => !s.thread.isRunning}>
185
- <Composer.Send />
186
- </AuiIf>
187
- <AuiIf condition={(s) => s.thread.isRunning}>
188
- <Composer.Cancel />
189
- </AuiIf>
190
- </>
191
- );
192
- };
193
- ```
194
-
195
- ### Composer.Send
196
-
197
- The button to send the message.
198
-
199
- ### Composer.Cancel
200
-
201
- Sends a cancel action.
202
-
203
- ### Composer.Attachments
204
-
205
- Renders attachments.
206
-
207
- ### Composer.AddAttachment
208
-
209
- Renders an add attachment button.
210
-
211
- ## AttachmentUI
212
-
213
- <Callout type="info" emoji="💡">
214
- `AttachmentUI` is still experimental.
215
- </Callout>
216
-
217
- Renders an attachment.
218
-
219
- ```tsx
220
- import { AttachmentUI } from "@assistant-ui/react-ui";
221
-
222
- const MyAttachmentUI: FC = () => {
223
- return (
224
- <AttachmentUI.Root>
225
- attachment
226
- <AttachmentUI.Remove />
227
- </AttachmentUI.Root>
228
- );
229
- };
230
- ```
231
-
232
- ### AttachmentUI.Root
233
-
234
- Contains all parts of the composer attachment.
235
-
236
- ### AttachmentUI.Remove
237
-
238
- Renders a remove attachment button.
239
-
240
- ## AssistantMessage
241
-
242
- Renders an assistant message.
243
-
244
- ```tsx
245
- import { AssistantMessage } from "@assistant-ui/react-ui";
246
-
247
- const MyAssistantMessage: FC = () => {
248
- return (
249
- <AssistantMessage.Root>
250
- <AssistantMessage.Avatar />
251
- <AssistantMessage.Content />
252
- <BranchPicker />
253
- <AssistantActionBar />
254
- </AssistantMessage.Root>
255
- );
256
- };
257
- ```
258
-
259
- **Usage:**
260
-
261
- Decompose `Thread` into `MyThread` and pass `MyAssistantMessage` to Thread.MEssages
262
-
263
- ```ts
264
- const MyThread: FC<ThreadConfig> = (config) => {
265
- ...
266
- <Thread.Messages components={{ AssistantMessage: MyAssistantMessage }} />
267
- ...
268
- };
269
- ```
270
-
271
- ### AssistantMessage.Root
272
-
273
- Contains all parts of the assistant message.
274
-
275
- ### AssistantMessage.Avatar
276
-
277
- The avatar of the assistant.
278
-
279
- ### AssistantMessage.Content
280
-
281
- The content of the assistant message.
282
-
283
- ## AssistantActionBar
284
-
285
- Renders the action bar for the assistant message.
286
-
287
- ```tsx
288
- import { AssistantActionBar } from "@assistant-ui/react-ui";
289
-
290
- const MyAssistantActionBar: FC = () => {
291
- return (
292
- <AssistantActionBar.Root
293
- hideWhenRunning
294
- autohide="not-last"
295
- autohideFloat="single-branch"
296
- >
297
- <AssistantActionBar.SpeechControl />
298
- <AssistantActionBar.Copy />
299
- <AssistantActionBar.Reload />
300
- <AssistantActionBar.FeedbackPositive />
301
- <AssistantActionBar.FeedbackNegative />
302
- </AssistantActionBar.Root>
303
- );
304
- };
305
- ```
306
-
307
- **Usage:**
308
-
309
- Decompose `AssistantMessage` into `MyAssistantMessage` and use `MyAssistantActionBar` instead of `AssistantActionBar`.
310
-
311
- ```ts
312
- const MyAssistantMessage: FC = () => {
313
- ...
314
- <MyAssistantActionBar />
315
- ...
316
- };
317
- ```
318
-
319
- ### AssistantActionBar.Root
320
-
321
- Contains all parts of the assistant action bar.
322
-
323
- ### AssistantActionBar.Reload
324
-
325
- Shows a reload button.
326
-
327
- ### AssistantActionBar.Copy
328
-
329
- Shows a copy button.
330
-
331
- ### AssistantActionBar.SpeechControl
332
-
333
- Shows a speech control button (either Speak or StopSpeaking).
334
-
335
- ### AssistantActionBar.Speak
336
-
337
- Shows a speak button.
338
-
339
- ### AssistantActionBar.StopSpeaking
340
-
341
- Shows a stop speaking button.
342
-
343
- ### AssistantActionBar.FeedbackPositive
344
-
345
- Shows a positive feedback button.
346
-
347
- ### AssistantActionBar.FeedbackNegative
348
-
349
- Shows a negative feedback button.
350
-
351
- ## BranchPicker
352
-
353
- Renders the branch picker.
354
-
355
- ```tsx
356
- import { BranchPicker } from "@assistant-ui/react-ui";
357
-
358
- const MyBranchPicker: FC = () => {
359
- return (
360
- <BranchPicker.Root hideWhenSingleBranch>
361
- <BranchPicker.Previous />
362
- <BranchPicker.State />
363
- <BranchPicker.Next />
364
- </BranchPicker.Root>
365
- );
366
- };
367
- ```
368
-
369
- **Usage:**
370
-
371
- Decompose `AssistantMessage` and `UserMessage` and use `MyBranchPicker` instead of `BranchPicker`.
372
-
373
- ```ts
374
- const MyAssistantMessage: FC = () => {
375
- ...
376
- <MyBranchPicker />
377
- ...
378
- };
379
- ```
380
-
381
- ```ts
382
- const MyUserMessage: FC = () => {
383
- ...
384
- <MyBranchPicker />
385
- ...
386
- };
387
- ```
388
-
389
- ### BranchPicker.Root
390
-
391
- Contains all parts of the branch picker.
392
-
393
- ### BranchPicker.Previous
394
-
395
- Shows a previous button.
396
-
397
- ### BranchPicker.Next
398
-
399
- Shows a next button.
400
-
401
- ### BranchPicker.State
402
-
403
- Shows the current branch number and total number of branches.
404
-
405
- ```tsx
406
- import { BranchPicker } from "@assistant-ui/react-ui";
407
-
408
- const MyBranchPickerState: FC = () => {
409
- return (
410
- <span className="aui-branch-picker-state">
411
- <BranchPicker.Number /> / <BranchPicker.Count />
412
- </span>
413
- );
414
- };
415
- ```
416
-
417
- ### BranchPicker.Number
418
-
419
- The current branch number.
420
-
421
- ### BranchPicker.Count
422
-
423
- The total number of branches.
424
-
425
- ## UserMessage
426
-
427
- Renders a user message.
428
-
429
- ```tsx
430
- import { UserMessage } from "@assistant-ui/react-ui";
431
-
432
- const MyUserMessage: FC = () => {
433
- return (
434
- <UserMessage.Root>
435
- <UserMessage.Attachments />
436
- <UserMessage.Content />
437
- <UserActionBar />
438
- <BranchPicker />
439
- </UserMessage.Root>
440
- );
441
- };
442
- ```
443
-
444
- **Usage:**
445
-
446
- Decompose `Thread` into `MyThread` and pass `MyUserMessage` to Thread.Messages
447
-
448
- ```ts
449
- const MyThread: FC<ThreadConfig> = (config) => {
450
- ...
451
- <Thread.Messages components={{ UserMessage: MyUserMessage }} />
452
- ...
453
- };
454
- ```
455
-
456
- ### UserMessage.Root
457
-
458
- Contains all parts of the user message.
459
-
460
- ### UserMessage.Content
461
-
462
- The content of the user message.
463
-
464
- ### UserMessage.Attachments
465
-
466
- Renders attachments.
467
-
468
- ## UserActionBar
469
-
470
- Renders the action bar for the user message.
471
-
472
- ```tsx
473
- import { UserActionBar } from "@assistant-ui/react-ui";
474
-
475
- const MyUserActionBar: FC = () => {
476
- return (
477
- <UserActionBar.Root hideWhenRunning autohide="not-last">
478
- <UserActionBar.Edit />
479
- </UserActionBar.Root>
480
- );
481
- };
482
- ```
483
-
484
- **Usage:**
485
-
486
- Decompose `UserMessage` into `MyUserMessage` and use `MyUserActionBar` instead of `UserActionBar`.
487
-
488
- ```ts
489
- const MyUserMessage: FC = () => {
490
- ...
491
- <MyUserActionBar />
492
- ...
493
- };
494
- ```
495
-
496
- ### UserActionBar.Root
497
-
498
- Contains all parts of the user action bar.
499
-
500
- ### UserActionBar.Edit
501
-
502
- Shows an edit button.
503
-
504
- ## UserAttachment
505
-
506
- Renders an attachment.
507
-
508
- ```tsx
509
- import { UserAttachment } from "@assistant-ui/react-ui";
510
-
511
- const MyUserAttachment: FC = () => {
512
- return <UserAttachment.Root>attachment</UserAttachment.Root>;
513
- };
514
- ```
515
-
516
- ### UserAttachment.Root
517
-
518
- Contains all parts of the user attachment.
519
-
520
- ## EditComposer
521
-
522
- Renders a user message being edited.
523
-
524
- ```tsx
525
- import { EditComposer } from "@assistant-ui/react-ui";
526
-
527
- const MyEditComposer: FC = () => {
528
- return (
529
- <EditComposer.Root>
530
- <EditComposer.Input />
531
- <EditComposer.Footer>
532
- <EditComposer.Cancel />
533
- <EditComposer.Send />
534
- </EditComposer.Footer>
535
- </EditComposer.Root>
536
- );
537
- };
538
- ```
539
-
540
- **Usage:**
541
-
542
- Decompose `Thread` into `MyThread` and pass `MyEditComposer` to `Thread.Messages`.
543
-
544
- ```ts
545
- const MyThread: FC<ThreadConfig> = (config) => {
546
- ...
547
- <Thread.Messages components={{ EditComposer: MyEditComposer }} />
548
- ...
549
- };
550
- ```
551
-
552
- ### EditComposer.Root
553
-
554
- Contains all parts of the edit composer.
555
-
556
- ### EditComposer.Input
557
-
558
- The text input field for the user to type a new message.
559
-
560
- ### EditComposer.Footer
561
-
562
- The footer of the edit composer.
563
-
564
- ### EditComposer.Cancel
565
-
566
- Sends a cancel action.
567
-
568
- ### EditComposer.Send
569
-
570
- Sends the message.
571
-
572
- ## AssistantModal
573
-
574
- Renders the assistant modal.
575
-
576
- ```tsx
577
- import {
578
- AssistantModal,
579
- Thread,
580
- type ThreadConfig,
581
- } from "@assistant-ui/react-ui";
582
-
583
- const MyAssistantModal: FC<ThreadConfig> = (config) => {
584
- return (
585
- <AssistantModal.Root config={config}>
586
- <AssistantModal.Trigger />
587
- <AssistantModal.Content>
588
- <Thread />
589
- </AssistantModal.Content>
590
- </AssistantModal.Root>
591
- );
592
- };
593
- ```
594
-
595
- **Usage:**
596
-
597
- ```ts
598
- <MyAssistantModal />
599
- ```
600
-
601
- ## ThreadList
602
-
603
- Renders a thread list.
604
-
605
- ```tsx
606
- import { ThreadList, ThreadListItem } from "@assistant-ui/react-ui";
607
-
608
- const MyThreadList = () => {
609
- return (
610
- <ThreadList.Root>
611
- <ThreadList.New />
612
- <ThreadList.Items />
613
- </ThreadList.Root>
614
- );
615
- };
616
- ```
617
-
618
- ### ThreadListItem
619
-
620
- Renders a thread list item.
621
-
622
- ```tsx
623
- import { ThreadListItem, ThreadListItemPrimitive } from "@assistant-ui/react-ui";
624
-
625
- const MyThreadListItem = () => {
626
- return (
627
- <ThreadListItem.Root>
628
- <ThreadListItemTrigger>
629
- <ThreadListItemTitle />
630
- </ThreadListItemTrigger>
631
- <ThreadListItem.Archive />
632
- </ThreadListItem.Root>
633
- );
634
- };
635
- ```
@@ -1,77 +0,0 @@
1
- ---
2
- title: Markdown
3
- description: Enable rich text formatting for assistant messages using markdown.
4
- ---
5
-
6
- Allow the assistant to display rich text using markdown.
7
-
8
-
9
- ## Enabling markdown support
10
-
11
- <Steps>
12
-
13
- <Step>
14
- ### Install `@assistant-ui/react-markdown`
15
-
16
- <InstallCommand npm={["@assistant-ui/react-markdown"]} />
17
-
18
- </Step>
19
- <Step>
20
-
21
- ### Setup styles
22
-
23
- <Tabs items={["Tailwind", "Tailwind + shadcn-ui"]}>
24
-
25
- ```ts {3} title="/tailwind.config.ts" tab="Tailwind"
26
- {
27
- plugins: [
28
- require("tailwindcss-animate"),
29
- require("@assistant-ui/react-ui/tailwindcss")
30
- ],
31
- }
32
- ```
33
-
34
- ```ts title="/tailwind.config.ts" tab="Tailwind + shadcn-ui"
35
- {
36
- plugins: [
37
- require("tailwindcss-animate"),
38
- require("@assistant-ui/react-ui/tailwindcss")({ shadcn: true })
39
- ],
40
- }
41
- ```
42
-
43
- </Tabs>
44
-
45
- </Step>
46
-
47
- <Step>
48
-
49
- ### Define a `MarkdownText` component
50
-
51
- ```tsx {1} title="@/components/markdown-text.tsx"
52
- import { makeMarkdownText } from "@assistant-ui/react-ui";
53
-
54
- export const MarkdownText = makeMarkdownText();
55
- ```
56
-
57
- </Step>
58
-
59
- <Step>
60
-
61
- ### Use it with `Thread`
62
-
63
- Pass the `MarkdownText` component to your `Thread` component.
64
-
65
- ```tsx {1, 7}
66
- import { MarkdownText } from "@/components/markdown-text";
67
-
68
- const Home = () => {
69
- return (
70
- <Thread assistantMessage={{ components: { Text: MarkdownText } }}>
71
- );
72
- };
73
- ```
74
-
75
- </Step>
76
-
77
- </Steps>