@assistant-ui/mcp-docs-server 0.1.38 → 0.2.0
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.
- package/.docs/organized/code-examples/waterfall.md +11 -12
- package/.docs/organized/code-examples/with-a2a.md +18 -13
- package/.docs/organized/code-examples/with-ag-ui.md +19 -14
- package/.docs/organized/code-examples/{with-ai-sdk-v6.md → with-ai-sdk-v7.md} +34 -23
- package/.docs/organized/code-examples/with-artifacts.md +473 -141
- package/.docs/organized/code-examples/with-assistant-transport.md +17 -10
- package/.docs/organized/code-examples/with-browser-extension.md +17 -10
- package/.docs/organized/code-examples/with-chain-of-thought.md +21 -14
- package/.docs/organized/code-examples/with-cloud-standalone.md +12 -11
- package/.docs/organized/code-examples/with-cloud.md +20 -15
- package/.docs/organized/code-examples/with-custom-thread-list.md +19 -12
- package/.docs/organized/code-examples/with-elevenlabs-conversational.md +22 -15
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +22 -15
- package/.docs/organized/code-examples/with-eve.md +18 -11
- package/.docs/organized/code-examples/with-expo.md +35 -52
- package/.docs/organized/code-examples/with-external-store.md +18 -13
- package/.docs/organized/code-examples/with-ffmpeg.md +20 -15
- package/.docs/organized/code-examples/with-generative-ui.md +22 -17
- package/.docs/organized/code-examples/with-google-adk.md +18 -11
- package/.docs/organized/code-examples/with-heat-graph.md +10 -11
- package/.docs/organized/code-examples/with-image-generation.md +19 -12
- package/.docs/organized/code-examples/with-interactables.md +21 -17
- package/.docs/organized/code-examples/with-langchain.md +19 -12
- package/.docs/organized/code-examples/with-langgraph.md +19 -12
- package/.docs/organized/code-examples/with-livekit.md +23 -16
- package/.docs/organized/code-examples/with-mcp.md +46 -28
- package/.docs/organized/code-examples/with-opencode.md +25 -23
- package/.docs/organized/code-examples/with-pi.md +54 -19
- package/.docs/organized/code-examples/with-react-hook-form.md +21 -16
- package/.docs/organized/code-examples/with-react-ink-web.md +9 -9
- package/.docs/organized/code-examples/with-react-ink.md +4 -4
- package/.docs/organized/code-examples/with-react-router.md +22 -17
- package/.docs/organized/code-examples/with-resumable-stream.md +21 -14
- package/.docs/organized/code-examples/with-store.md +10 -11
- package/.docs/organized/code-examples/with-tanstack.md +19 -13
- package/.docs/organized/code-examples/with-tap-runtime.md +18 -13
- package/.docs/organized/code-examples/with-virtualized-thread.md +19 -14
- package/.docs/raw/docs/(docs)/base-ui.mdx +39 -0
- package/.docs/raw/docs/(docs)/cli.mdx +19 -1
- package/.docs/raw/docs/(docs)/devtools.mdx +7 -2
- package/.docs/raw/docs/(docs)/installation.mdx +15 -1
- package/.docs/raw/docs/(docs)/rtl.mdx +2 -4
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/a2ui.mdx +40 -0
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/actions.mdx +56 -0
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/components.mdx +86 -0
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/index.mdx +22 -1
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/json-generative-ui.mdx +42 -0
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/rendering.mdx +53 -2
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/slack.mdx +81 -0
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/teams.mdx +86 -0
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/tokens.mdx +62 -0
- package/.docs/raw/docs/(reference)/api-reference/hooks/primitives.mdx +19 -420
- package/.docs/raw/docs/(reference)/api-reference/hooks/state.mdx +4 -1
- package/.docs/raw/docs/(reference)/api-reference/integrations/index.mdx +4 -1
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-ai-sdk.mdx +25 -2
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-data-stream.mdx +37 -0
- package/.docs/raw/docs/(reference)/api-reference/model-context/context.mdx +1 -9
- package/.docs/raw/docs/(reference)/api-reference/overview.mdx +1 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-if.mdx +14 -31
- package/.docs/raw/docs/(reference)/api-reference/primitives/composition.mdx +1 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/index.mdx +3 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/selection-toolbar.mdx +2 -0
- package/.docs/raw/docs/(reference)/api-reference/tools/status.mdx +0 -2
- package/.docs/raw/docs/(reference)/api-reference/tools/toolkits.mdx +12 -9
- package/.docs/raw/docs/(reference)/api-reference/utilities/miscellaneous.mdx +4 -0
- package/.docs/raw/docs/cloud/ai-sdk-assistant-ui.mdx +7 -1
- package/.docs/raw/docs/cloud/langgraph.mdx +4 -2
- package/.docs/raw/docs/copilots/model-context.mdx +1 -1
- package/.docs/raw/docs/copilots/motivation.mdx +1 -1
- package/.docs/raw/docs/guides/attachments.mdx +3 -3
- package/.docs/raw/docs/guides/branching.mdx +2 -2
- package/.docs/raw/docs/guides/chatgpt-subscription.mdx +108 -0
- package/.docs/raw/docs/guides/context-api.mdx +89 -111
- package/.docs/raw/docs/guides/dictation.mdx +185 -257
- package/.docs/raw/docs/guides/editing.mdx +5 -5
- package/.docs/raw/docs/guides/electron.mdx +369 -0
- package/.docs/raw/docs/guides/index.mdx +20 -0
- package/.docs/raw/docs/guides/mentions.mdx +31 -3
- package/.docs/raw/docs/guides/quoting.mdx +3 -3
- package/.docs/raw/docs/guides/resumable-stream-deployment.mdx +2 -2
- package/.docs/raw/docs/guides/resumable-streams.mdx +12 -1
- package/.docs/raw/docs/guides/speech.mdx +47 -29
- package/.docs/raw/docs/guides/suggestions.mdx +70 -1
- package/.docs/raw/docs/guides/voice.mdx +197 -267
- package/.docs/raw/docs/ink/hooks.mdx +3 -3
- package/.docs/raw/docs/ink/primitives.mdx +49 -8
- package/.docs/raw/docs/integrations/auth/better-auth.mdx +2 -2
- package/.docs/raw/docs/integrations/auth/clerk.mdx +2 -2
- package/.docs/raw/docs/integrations/auth/next-auth.mdx +3 -3
- package/.docs/raw/docs/integrations/frameworks/ai-sdk.mdx +10 -4
- package/.docs/raw/docs/integrations/frameworks/cloudflare-agents/overview.mdx +3 -3
- package/.docs/raw/docs/integrations/frameworks/mastra/full-stack.mdx +1 -1
- package/.docs/raw/docs/integrations/frameworks/mastra/overview.mdx +3 -3
- package/.docs/raw/docs/integrations/frameworks/mastra/separate-server.mdx +1 -1
- package/.docs/raw/docs/integrations/gateways/index.mdx +2 -2
- package/.docs/raw/docs/integrations/observability/helicone.mdx +1 -1
- package/.docs/raw/docs/integrations/observability/langfuse.mdx +1 -1
- package/.docs/raw/docs/integrations/observability/langsmith.mdx +2 -2
- package/.docs/raw/docs/integrations/persistence/custom-adapter.mdx +36 -9
- package/.docs/raw/docs/migrations/index.mdx +50 -0
- package/.docs/raw/docs/migrations/toolkit-tools.mdx +4 -2
- package/.docs/raw/docs/migrations/v0-15.mdx +156 -0
- package/.docs/raw/docs/primitives/chain-of-thought.mdx +6 -1
- package/.docs/raw/docs/primitives/composer.mdx +17 -1
- package/.docs/raw/docs/primitives/selection-toolbar.mdx +25 -0
- package/.docs/raw/docs/primitives/thread-list.mdx +2 -2
- package/.docs/raw/docs/react-native/hooks.mdx +3 -3
- package/.docs/raw/docs/react-native/index.mdx +2 -2
- package/.docs/raw/docs/react-native/primitives.mdx +62 -5
- package/.docs/raw/docs/runtimes/ag-ui/agent-state.mdx +124 -0
- package/.docs/raw/docs/runtimes/ag-ui/runtime-options.mdx +10 -1
- package/.docs/raw/docs/runtimes/ai-sdk/overview.mdx +14 -5
- package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +15 -15
- package/.docs/raw/docs/runtimes/ai-sdk/v5-legacy.mdx +8 -8
- package/.docs/raw/docs/runtimes/ai-sdk/{v6.mdx → v6-legacy.mdx} +11 -9
- package/.docs/raw/docs/runtimes/ai-sdk/v7.mdx +717 -0
- package/.docs/raw/docs/runtimes/concepts/adapters.mdx +1 -1
- package/.docs/raw/docs/runtimes/concepts/architecture.mdx +1 -1
- package/.docs/raw/docs/runtimes/concepts/threads.mdx +10 -10
- package/.docs/raw/docs/runtimes/custom/assistant-transport.mdx +2 -2
- package/.docs/raw/docs/runtimes/custom/data-stream.mdx +10 -19
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +2 -2
- package/.docs/raw/docs/runtimes/custom/local-runtime.mdx +5 -3
- package/.docs/raw/docs/runtimes/eve/overview.mdx +1 -1
- package/.docs/raw/docs/runtimes/langchain.mdx +2 -2
- package/.docs/raw/docs/runtimes/langgraph/agent-state.mdx +181 -0
- package/.docs/raw/docs/runtimes/langgraph/overview.mdx +1 -1
- package/.docs/raw/docs/runtimes/opencode/hooks.mdx +3 -1
- package/.docs/raw/docs/tools/a2ui.mdx +107 -0
- package/.docs/raw/docs/tools/backend.mdx +6 -3
- package/.docs/raw/docs/tools/defining-tools.mdx +7 -1
- package/.docs/raw/docs/tools/generative-ui.mdx +60 -2
- package/.docs/raw/docs/tools/interactables-legacy.mdx +4 -4
- package/.docs/raw/docs/tools/interactables.mdx +3 -3
- package/.docs/raw/docs/tools/mcp-apps.mdx +90 -13
- package/.docs/raw/docs/tools/mcp.mdx +100 -3
- package/.docs/raw/docs/tools/tool-ui.mdx +6 -4
- package/.docs/raw/docs/tools/user-managed-mcp.mdx +77 -9
- package/.docs/raw/docs/ui/accordion.mdx +16 -10
- package/.docs/raw/docs/ui/assistant-modal.mdx +8 -4
- package/.docs/raw/docs/ui/attachment.mdx +5 -1
- package/.docs/raw/docs/ui/badge.mdx +23 -12
- package/.docs/raw/docs/ui/follow-up-suggestions.mdx +4 -2
- package/.docs/raw/docs/ui/model-selector.mdx +33 -3
- package/.docs/raw/docs/ui/part-grouping.mdx +0 -4
- package/.docs/raw/docs/ui/reasoning.mdx +1 -1
- package/.docs/raw/docs/ui/select.mdx +22 -14
- package/.docs/raw/docs/ui/sources.mdx +1 -1
- package/.docs/raw/docs/ui/tabs.mdx +25 -14
- package/.docs/raw/docs/utilities/heat-graph.mdx +2 -2
- package/dist/constants.d.ts.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +41 -2
- package/dist/index.js.map +1 -1
- package/dist/prepare-docs/code-examples.d.ts.map +1 -1
- package/dist/prepare-docs/code-examples.js.map +1 -1
- package/dist/prepare-docs/copy-raw.d.ts.map +1 -1
- package/dist/prepare-docs/prepare.d.ts +1 -1
- package/dist/prompts/xulux-playground.d.ts +12 -0
- package/dist/prompts/xulux-playground.d.ts.map +1 -0
- package/dist/prompts/xulux-playground.js +33 -0
- package/dist/prompts/xulux-playground.js.map +1 -0
- package/dist/stdio.d.ts +1 -1
- package/dist/tools/docs.d.ts +8 -14
- package/dist/tools/docs.d.ts.map +1 -1
- package/dist/tools/docs.js +26 -10
- package/dist/tools/docs.js.map +1 -1
- package/dist/tools/examples.d.ts +6 -12
- package/dist/tools/examples.d.ts.map +1 -1
- package/dist/tools/examples.js +11 -8
- package/dist/tools/examples.js.map +1 -1
- package/dist/tools/resources.d.ts +1 -2
- package/dist/tools/resources.d.ts.map +1 -1
- package/dist/tools/resources.js +1 -1
- package/dist/tools/resources.js.map +1 -1
- package/dist/tools/search.d.ts +6 -15
- package/dist/tools/search.d.ts.map +1 -1
- package/dist/tools/search.js +2 -2
- package/dist/tools/search.js.map +1 -1
- package/dist/tools/tests/mcp-test-client.d.ts +15 -0
- package/dist/tools/tests/mcp-test-client.d.ts.map +1 -0
- package/dist/tools/tests/mcp-test-client.js +68 -0
- package/dist/tools/tests/mcp-test-client.js.map +1 -0
- package/dist/tools/tests/test-setup.d.ts.map +1 -1
- package/dist/tools/tests/test-setup.js +5 -1
- package/dist/tools/tests/test-setup.js.map +1 -1
- package/dist/tools/xulux-templates.d.ts +58 -0
- package/dist/tools/xulux-templates.d.ts.map +1 -0
- package/dist/tools/xulux-templates.js +82 -0
- package/dist/tools/xulux-templates.js.map +1 -0
- package/dist/utils/cache.d.ts +5 -0
- package/dist/utils/cache.d.ts.map +1 -0
- package/dist/utils/cache.js +18 -0
- package/dist/utils/cache.js.map +1 -0
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/mcp-format.d.ts +1 -0
- package/dist/utils/mcp-format.d.ts.map +1 -1
- package/dist/utils/mcp-format.js +7 -4
- package/dist/utils/mcp-format.js.map +1 -1
- package/dist/utils/mdx.d.ts.map +1 -1
- package/dist/utils/paths.d.ts +1 -1
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +3 -1
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/search.d.ts.map +1 -1
- package/dist/utils/security.d.ts.map +1 -1
- package/dist/utils/security.js.map +1 -1
- package/dist/xulux/catalog-client.d.ts +14 -0
- package/dist/xulux/catalog-client.d.ts.map +1 -0
- package/dist/xulux/catalog-client.js +67 -0
- package/dist/xulux/catalog-client.js.map +1 -0
- package/dist/xulux/fallback-catalog.d.ts +7 -0
- package/dist/xulux/fallback-catalog.d.ts.map +1 -0
- package/dist/xulux/fallback-catalog.js +47 -0
- package/dist/xulux/fallback-catalog.js.map +1 -0
- package/dist/xulux/fetch-sandbox.d.ts +5 -0
- package/dist/xulux/fetch-sandbox.d.ts.map +1 -0
- package/dist/xulux/fetch-sandbox.js +40 -0
- package/dist/xulux/fetch-sandbox.js.map +1 -0
- package/dist/xulux/template-service.d.ts +84 -0
- package/dist/xulux/template-service.d.ts.map +1 -0
- package/dist/xulux/template-service.js +223 -0
- package/dist/xulux/template-service.js.map +1 -0
- package/dist/xulux/types.d.ts +55 -0
- package/dist/xulux/types.d.ts.map +1 -0
- package/dist/xulux/types.js +6 -0
- package/dist/xulux/types.js.map +1 -0
- package/package.json +7 -6
- package/src/index.ts +55 -2
- package/src/prompts/xulux-playground.ts +36 -0
- package/src/tools/docs.ts +27 -5
- package/src/tools/examples.ts +17 -12
- package/src/tools/resources.ts +1 -4
- package/src/tools/search.ts +2 -2
- package/src/tools/tests/completions.test.ts +40 -26
- package/src/tools/tests/docs.test.ts +20 -0
- package/src/tools/tests/examples.test.ts +5 -5
- package/src/tools/tests/integration.test.ts +3 -4
- package/src/tools/tests/listings-cache.test.ts +19 -0
- package/src/tools/tests/mcp-protocol.test.ts +173 -108
- package/src/tools/tests/mcp-test-client.ts +111 -0
- package/src/tools/tests/resources.test.ts +97 -66
- package/src/tools/tests/test-setup.ts +8 -0
- package/src/tools/tests/xulux-templates.test.ts +262 -0
- package/src/tools/xulux-templates.ts +141 -0
- package/src/utils/cache.ts +20 -0
- package/src/utils/mcp-format.ts +8 -6
- package/src/utils/paths.ts +4 -1
- package/src/utils/tests/cache.test.ts +51 -0
- package/src/utils/tests/mcp-format.test.ts +22 -0
- package/src/utils/tests/security.test.ts +1 -1
- package/src/xulux/catalog-client.ts +105 -0
- package/src/xulux/fallback-catalog.ts +63 -0
- package/src/xulux/fetch-sandbox.ts +56 -0
- package/src/xulux/template-service.ts +406 -0
- package/src/xulux/types.ts +60 -0
- package/.docs/raw/docs/(reference)/api-reference/hooks/utilities.mdx +0 -464
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
title: Accordion
|
|
3
3
|
description: A vertically stacked set of interactive headings that reveal or hide content sections.
|
|
4
4
|
links:
|
|
5
|
-
- label: Radix UI Accordion
|
|
5
|
+
- label: Radix UI Accordion (Radix styles)
|
|
6
6
|
url: https://www.radix-ui.com/primitives/docs/components/accordion
|
|
7
|
+
- label: Base UI Accordion (base styles)
|
|
8
|
+
url: https://base-ui.com/react/components/accordion
|
|
7
9
|
platforms: ["react"]
|
|
8
10
|
---
|
|
9
11
|
|
|
@@ -16,12 +18,16 @@ import {
|
|
|
16
18
|
AccordionControlledSample,
|
|
17
19
|
AccordionFAQSample,
|
|
18
20
|
} from "@/components/docs/samples/accordion";
|
|
21
|
+
import * as AccordionRadixSamples from "@/components/docs/samples/accordion.radix";
|
|
22
|
+
import { Flavored, FlavorSwitcher } from "@/components/docs/contexts/flavor.server";
|
|
19
23
|
|
|
20
24
|
<Callout>
|
|
21
25
|
This is a **standalone component** that does not depend on the assistant-ui runtime. Use it anywhere in your application.
|
|
22
26
|
</Callout>
|
|
23
27
|
|
|
24
|
-
<
|
|
28
|
+
<FlavorSwitcher />
|
|
29
|
+
|
|
30
|
+
<Flavored radix={<AccordionRadixSamples.AccordionSample />} base={<AccordionSample />} />
|
|
25
31
|
|
|
26
32
|
## Installation
|
|
27
33
|
|
|
@@ -59,7 +65,7 @@ export function Example() {
|
|
|
59
65
|
|
|
60
66
|
Use the `variant` prop on `Accordion` to change the visual style. Child components inherit the variant automatically.
|
|
61
67
|
|
|
62
|
-
<AccordionVariantsSample />
|
|
68
|
+
<Flavored radix={<AccordionRadixSamples.AccordionVariantsSample />} base={<AccordionVariantsSample />} />
|
|
63
69
|
|
|
64
70
|
```tsx
|
|
65
71
|
// Default - border-bottom separator
|
|
@@ -91,7 +97,7 @@ Use the `variant` prop on `Accordion` to change the visual style. Child componen
|
|
|
91
97
|
|
|
92
98
|
Use `type="multiple"` to allow multiple items to be open simultaneously.
|
|
93
99
|
|
|
94
|
-
<AccordionMultipleSample />
|
|
100
|
+
<Flavored radix={<AccordionRadixSamples.AccordionMultipleSample />} base={<AccordionMultipleSample />} />
|
|
95
101
|
|
|
96
102
|
```tsx
|
|
97
103
|
<Accordion type="multiple">
|
|
@@ -110,24 +116,24 @@ Use `type="multiple"` to allow multiple items to be open simultaneously.
|
|
|
110
116
|
|
|
111
117
|
Add icons or custom elements inside the trigger.
|
|
112
118
|
|
|
113
|
-
<PreviewCode file="components/docs/samples/accordion" name="AccordionWithIconsSample">
|
|
114
|
-
<AccordionWithIconsSample />
|
|
119
|
+
<PreviewCode file="components/docs/samples/accordion" name="AccordionWithIconsSample" base={<AccordionWithIconsSample />}>
|
|
120
|
+
<AccordionRadixSamples.AccordionWithIconsSample />
|
|
115
121
|
</PreviewCode>
|
|
116
122
|
|
|
117
123
|
### Controlled
|
|
118
124
|
|
|
119
125
|
Use `value` and `onValueChange` for controlled accordion state.
|
|
120
126
|
|
|
121
|
-
<PreviewCode file="components/docs/samples/accordion" name="AccordionControlledSample">
|
|
122
|
-
<AccordionControlledSample />
|
|
127
|
+
<PreviewCode file="components/docs/samples/accordion" name="AccordionControlledSample" base={<AccordionControlledSample />}>
|
|
128
|
+
<AccordionRadixSamples.AccordionControlledSample />
|
|
123
129
|
</PreviewCode>
|
|
124
130
|
|
|
125
131
|
### FAQ Section
|
|
126
132
|
|
|
127
133
|
A practical example of using accordion for a FAQ section.
|
|
128
134
|
|
|
129
|
-
<PreviewCode file="components/docs/samples/accordion" name="AccordionFAQSample">
|
|
130
|
-
<AccordionFAQSample />
|
|
135
|
+
<PreviewCode file="components/docs/samples/accordion" name="AccordionFAQSample" base={<AccordionFAQSample />}>
|
|
136
|
+
<AccordionRadixSamples.AccordionFAQSample />
|
|
131
137
|
</PreviewCode>
|
|
132
138
|
|
|
133
139
|
## API Reference
|
|
@@ -5,10 +5,14 @@ platforms: ["react"]
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
import { AssistantModalSample } from "@/components/docs/samples/assistant-modal";
|
|
8
|
+
import * as AssistantModalRadixSamples from "@/components/docs/samples/assistant-modal.radix";
|
|
9
|
+
import { Flavored, FlavorSwitcher } from "@/components/docs/contexts/flavor.server";
|
|
8
10
|
|
|
9
|
-
A floating chat modal built on Radix UI Popover. Ideal for support widgets, help desks, and embedded assistants.
|
|
11
|
+
A floating chat modal built on the popover primitive of your configured style (Radix UI Popover on Radix styles, Base UI Popover on `base-*` styles). Ideal for support widgets, help desks, and embedded assistants.
|
|
10
12
|
|
|
11
|
-
<
|
|
13
|
+
<FlavorSwitcher />
|
|
14
|
+
|
|
15
|
+
<Flavored radix={<AssistantModalRadixSamples.AssistantModalSample />} base={<AssistantModalSample />} />
|
|
12
16
|
|
|
13
17
|
## Getting Started
|
|
14
18
|
|
|
@@ -43,7 +47,7 @@ export default function Home() {
|
|
|
43
47
|
|
|
44
48
|
## Anatomy
|
|
45
49
|
|
|
46
|
-
The `AssistantModal`
|
|
50
|
+
The Radix flavor of `AssistantModal` is built with the following primitives. The Base UI flavor composes your project's Base UI Popover instead.
|
|
47
51
|
|
|
48
52
|
```tsx
|
|
49
53
|
import { AssistantModalPrimitive } from "@assistant-ui/react";
|
|
@@ -61,7 +65,7 @@ import { AssistantModalPrimitive } from "@assistant-ui/react";
|
|
|
61
65
|
|
|
62
66
|
### Root
|
|
63
67
|
|
|
64
|
-
Contains all parts of the modal
|
|
68
|
+
Contains all parts of the modal when using `AssistantModalPrimitive` (the Radix flavor). The Base UI flavor uses your project's Base UI Popover instead.
|
|
65
69
|
|
|
66
70
|
<ParametersTable
|
|
67
71
|
type="AssistantModalPrimitiveRootProps"
|
|
@@ -5,8 +5,12 @@ platforms: ["react"]
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
import { AttachmentSample } from "@/components/docs/samples/attachment";
|
|
8
|
+
import * as AttachmentRadixSamples from "@/components/docs/samples/attachment.radix";
|
|
9
|
+
import { Flavored, FlavorSwitcher } from "@/components/docs/contexts/flavor.server";
|
|
8
10
|
|
|
9
|
-
<
|
|
11
|
+
<FlavorSwitcher />
|
|
12
|
+
|
|
13
|
+
<Flavored radix={<AttachmentRadixSamples.AttachmentSample />} base={<AttachmentSample />} />
|
|
10
14
|
|
|
11
15
|
<Callout type="info">
|
|
12
16
|
**Note:** These components provide the UI for attachments, but you also need
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
title: Badge
|
|
3
3
|
description: A small label component for displaying status, categories, or metadata.
|
|
4
4
|
links:
|
|
5
|
-
- label: Radix UI Slot
|
|
5
|
+
- label: Radix UI Slot (Radix styles)
|
|
6
6
|
url: https://www.radix-ui.com/primitives/docs/utilities/slot
|
|
7
|
+
- label: Base UI useRender (base styles)
|
|
8
|
+
url: https://base-ui.com/react/utils/use-render
|
|
7
9
|
platforms: ["react"]
|
|
8
10
|
---
|
|
9
11
|
|
|
@@ -15,12 +17,16 @@ import {
|
|
|
15
17
|
BadgeAsLinkSample,
|
|
16
18
|
BadgeAnimatedSample,
|
|
17
19
|
} from "@/components/docs/samples/badge";
|
|
20
|
+
import * as BadgeRadixSamples from "@/components/docs/samples/badge.radix";
|
|
21
|
+
import { Flavored, FlavorSwitcher } from "@/components/docs/contexts/flavor.server";
|
|
18
22
|
|
|
19
23
|
<Callout>
|
|
20
24
|
This is a **standalone component** that does not depend on the assistant-ui runtime. Use it anywhere in your application.
|
|
21
25
|
</Callout>
|
|
22
26
|
|
|
23
|
-
<
|
|
27
|
+
<FlavorSwitcher />
|
|
28
|
+
|
|
29
|
+
<Flavored radix={<BadgeRadixSamples.BadgeSample />} base={<BadgeSample />} />
|
|
24
30
|
|
|
25
31
|
## Installation
|
|
26
32
|
|
|
@@ -42,7 +48,7 @@ export function Example() {
|
|
|
42
48
|
|
|
43
49
|
Use the `variant` prop to change the visual style.
|
|
44
50
|
|
|
45
|
-
<BadgeSample />
|
|
51
|
+
<Flavored radix={<BadgeRadixSamples.BadgeSample />} base={<BadgeSample />} />
|
|
46
52
|
|
|
47
53
|
```tsx
|
|
48
54
|
<Badge variant="outline" /> // Border (default)
|
|
@@ -59,7 +65,7 @@ Use the `variant` prop to change the visual style.
|
|
|
59
65
|
|
|
60
66
|
Use the `size` prop to change the badge size.
|
|
61
67
|
|
|
62
|
-
<BadgeSizesSample />
|
|
68
|
+
<Flavored radix={<BadgeRadixSamples.BadgeSizesSample />} base={<BadgeSizesSample />} />
|
|
63
69
|
|
|
64
70
|
```tsx
|
|
65
71
|
<Badge size="sm" /> // Small
|
|
@@ -71,24 +77,24 @@ Use the `size` prop to change the badge size.
|
|
|
71
77
|
|
|
72
78
|
Badges automatically style SVG icons.
|
|
73
79
|
|
|
74
|
-
<PreviewCode file="components/docs/samples/badge" name="BadgeWithIconSample">
|
|
75
|
-
<BadgeWithIconSample />
|
|
80
|
+
<PreviewCode file="components/docs/samples/badge" name="BadgeWithIconSample" base={<BadgeWithIconSample />}>
|
|
81
|
+
<BadgeRadixSamples.BadgeWithIconSample />
|
|
76
82
|
</PreviewCode>
|
|
77
83
|
|
|
78
84
|
### As Link
|
|
79
85
|
|
|
80
|
-
|
|
86
|
+
Compose with `render` (Base UI) or `asChild` (Radix) to render the badge as a different element, like a link.
|
|
81
87
|
|
|
82
|
-
<PreviewCode file="components/docs/samples/badge" name="BadgeAsLinkSample">
|
|
83
|
-
<BadgeAsLinkSample />
|
|
88
|
+
<PreviewCode file="components/docs/samples/badge" name="BadgeAsLinkSample" base={<BadgeAsLinkSample />}>
|
|
89
|
+
<BadgeRadixSamples.BadgeAsLinkSample />
|
|
84
90
|
</PreviewCode>
|
|
85
91
|
|
|
86
92
|
### Animated
|
|
87
93
|
|
|
88
94
|
Combine with CSS transitions for scroll and color animations.
|
|
89
95
|
|
|
90
|
-
<PreviewCode file="components/docs/samples/badge" name="BadgeAnimatedSample">
|
|
91
|
-
<BadgeAnimatedSample />
|
|
96
|
+
<PreviewCode file="components/docs/samples/badge" name="BadgeAnimatedSample" base={<BadgeAnimatedSample />}>
|
|
97
|
+
<BadgeRadixSamples.BadgeAnimatedSample />
|
|
92
98
|
</PreviewCode>
|
|
93
99
|
|
|
94
100
|
## API Reference
|
|
@@ -110,11 +116,16 @@ Combine with CSS transitions for scroll and color animations.
|
|
|
110
116
|
default: '"default"',
|
|
111
117
|
description: "The size of the badge.",
|
|
112
118
|
},
|
|
119
|
+
{
|
|
120
|
+
name: "render",
|
|
121
|
+
type: "ReactElement | function",
|
|
122
|
+
description: "Base UI: compose as a different element instead of rendering a span.",
|
|
123
|
+
},
|
|
113
124
|
{
|
|
114
125
|
name: "asChild",
|
|
115
126
|
type: "boolean",
|
|
116
127
|
default: "false",
|
|
117
|
-
description: "
|
|
128
|
+
description: "Radix: merge props with a child element instead of rendering a span.",
|
|
118
129
|
},
|
|
119
130
|
{
|
|
120
131
|
name: "className",
|
|
@@ -23,7 +23,7 @@ import { FollowUpSuggestionsSample } from "@/components/docs/samples/follow-up-s
|
|
|
23
23
|
|
|
24
24
|
<InstallCommand shadcn={["follow-up-suggestions"]} />
|
|
25
25
|
|
|
26
|
-
This adds a `/components/assistant-ui/follow-up-suggestions.tsx` file to your project.
|
|
26
|
+
This adds a `/components/assistant-ui/follow-up-suggestions.tsx` file to your project. The default `thread` component already renders `ThreadFollowupSuggestions`, so installing it standalone is only needed when you build your own thread layout.
|
|
27
27
|
|
|
28
28
|
</Step>
|
|
29
29
|
<Step>
|
|
@@ -72,7 +72,9 @@ const ThreadViewportFooter = () => {
|
|
|
72
72
|
|
|
73
73
|
## Behavior
|
|
74
74
|
|
|
75
|
-
The component only renders when the thread is not empty
|
|
75
|
+
The component only renders when the thread is not empty, not currently running, and has at least one suggestion. Each suggestion uses `ThreadPrimitive.Suggestion`, replaces the composer text with the prompt, and sends it immediately.
|
|
76
|
+
|
|
77
|
+
Suggestions stay on a single line. When they overflow, the row scrolls horizontally without a scrollbar, and each edge with clipped content fades out — so no fade shows at the start edge until you scroll.
|
|
76
78
|
|
|
77
79
|
## Related Components
|
|
78
80
|
|
|
@@ -5,10 +5,14 @@ platforms: ["react"]
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
import { ModelSelectorSample } from "@/components/docs/samples/model-selector";
|
|
8
|
+
import * as ModelSelectorRadixSamples from "@/components/docs/samples/model-selector.radix";
|
|
9
|
+
import { Flavored, FlavorSwitcher } from "@/components/docs/contexts/flavor.server";
|
|
8
10
|
|
|
9
11
|
A picker that lets users switch between AI models and choose a reasoning effort (thinking) level. It is built on Popover + Command, so search, provider grouping, and filtering compose in without being built in. The default export integrates with assistant-ui's `ModelContext` system, so the selection reaches your backend on every request with no extra wiring.
|
|
10
12
|
|
|
11
|
-
<
|
|
13
|
+
<FlavorSwitcher />
|
|
14
|
+
|
|
15
|
+
<Flavored radix={<ModelSelectorRadixSamples.ModelSelectorSample />} base={<ModelSelectorSample />} />
|
|
12
16
|
|
|
13
17
|
## Getting Started
|
|
14
18
|
|
|
@@ -141,6 +145,26 @@ function EffortDropdown() {
|
|
|
141
145
|
|
|
142
146
|
Render it inside `ModelSelector.Content` in place of `ModelSelector.Effort`. The same hook supports any shape that reads the levels and writes the selection.
|
|
143
147
|
|
|
148
|
+
## Provider Logos
|
|
149
|
+
|
|
150
|
+
Each model's `icon` accepts any `ReactNode` and renders in the trigger and the dropdown items. The optional `logos` registry item ships `OpenAILogo`, `ClaudeLogo`, and `GeminiLogo` marks to plug in:
|
|
151
|
+
|
|
152
|
+
<InstallCommand shadcn={["logos"]} />
|
|
153
|
+
|
|
154
|
+
```tsx
|
|
155
|
+
import { ClaudeLogo, GeminiLogo, OpenAILogo } from "@/components/assistant-ui/logos";
|
|
156
|
+
|
|
157
|
+
<ModelSelector
|
|
158
|
+
models={[
|
|
159
|
+
{ id: "gpt-5.5", name: "GPT-5.5", icon: <OpenAILogo /> },
|
|
160
|
+
{ id: "claude-opus-4.5", name: "Claude Opus 4.5", icon: <ClaudeLogo /> },
|
|
161
|
+
{ id: "gemini-3-pro", name: "Gemini 3 Pro", icon: <GeminiLogo /> },
|
|
162
|
+
]}
|
|
163
|
+
/>;
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Icons are opt-in per model — omit `icon` and the entry renders text-only.
|
|
167
|
+
|
|
144
168
|
## Search
|
|
145
169
|
|
|
146
170
|
Search is opt-in. Pass `searchable` to the default component:
|
|
@@ -275,7 +299,7 @@ When `searchable` is set, typing filters the list; otherwise the keys above driv
|
|
|
275
299
|
|
|
276
300
|
The picker implements the WAI-ARIA combobox pattern over Popover + Command.
|
|
277
301
|
|
|
278
|
-
- The trigger is `role="combobox"` with `aria-haspopup="listbox"`;
|
|
302
|
+
- The trigger is `role="combobox"` with `aria-haspopup="listbox"`; the popover primitive manages `aria-expanded` and `aria-controls`.
|
|
279
303
|
- The model list is a Command (cmdk) listbox: each item is `role="option"` with `aria-selected`, and the active item is tracked with `aria-activedescendant`.
|
|
280
304
|
- Keyboard navigation works without a visible search box: `ModelSelector.Content` renders a visually hidden input (`ModelSelector.FocusAnchor`) that anchors cmdk's focus so the list stays reachable. Pass `searchable` to surface a real search input instead.
|
|
281
305
|
- The Thinking row (`ModelSelector.Effort`) is a `role="radiogroup"` of `role="radio"` toggles with roving tabindex, so it is a single tab stop and <Kbd>ArrowLeft</Kbd> / <Kbd>ArrowRight</Kbd> move focus and select in one step. <Kbd>ArrowUp</Kbd> / <Kbd>ArrowDown</Kbd> return focus to the model list.
|
|
@@ -284,7 +308,7 @@ The picker implements the WAI-ARIA combobox pattern over Popover + Command.
|
|
|
284
308
|
|
|
285
309
|
The default `ModelSelector` export registers the selection with assistant-ui's `ModelContext` system:
|
|
286
310
|
|
|
287
|
-
1. The component calls `aui.modelContext
|
|
311
|
+
1. The component calls `aui.modelContext.register()` with `config.modelName`, plus `config.reasoningEffort` when the selected model supports the chosen level
|
|
288
312
|
2. The `AssistantChatTransport` includes `config` in the request body of every chat request
|
|
289
313
|
3. Your API route reads `config.modelName` and `config.reasoningEffort`
|
|
290
314
|
|
|
@@ -351,6 +375,12 @@ This works out of the box with `@assistant-ui/react-ai-sdk`. `ModelSelector.Root
|
|
|
351
375
|
default: '"default"',
|
|
352
376
|
description: "Size of the trigger button.",
|
|
353
377
|
},
|
|
378
|
+
{
|
|
379
|
+
name: "align",
|
|
380
|
+
type: '"start" | "center" | "end"',
|
|
381
|
+
default: '"start"',
|
|
382
|
+
description: "Alignment of the dropdown relative to the trigger.",
|
|
383
|
+
},
|
|
354
384
|
{
|
|
355
385
|
name: "contentClassName",
|
|
356
386
|
type: "string",
|
|
@@ -248,10 +248,6 @@ The synthetic `"standalone-tool-call"` key on `groupPartByType` matches all of t
|
|
|
248
248
|
</MessagePrimitive.GroupedParts>;
|
|
249
249
|
```
|
|
250
250
|
|
|
251
|
-
<Callout type="info">
|
|
252
|
-
The `"mcp-app"` key is deprecated in favor of `"standalone-tool-call"`, which is a superset (it also matches MCP-app tool calls). Existing `"mcp-app"` usage keeps working.
|
|
253
|
-
</Callout>
|
|
254
|
-
|
|
255
251
|
### Render Tool Calls as Flat Rows
|
|
256
252
|
|
|
257
253
|
The previous section keeps `"tool-call"` folded into the chain-of-thought and only lifts standalone tool UIs out. To keep reasoning collapsed in a group while every tool call renders as its own row in the message flow, map both tool keys to `[]`:
|
|
@@ -28,7 +28,7 @@ Previously, reasoning parts were rendered via `components.Reasoning` and grouped
|
|
|
28
28
|
|
|
29
29
|
Render reasoning parts through `MessagePrimitive.GroupedParts`. Group consecutive reasoning parts with `"group-reasoning"`, then compose `ReasoningRoot`, `ReasoningTrigger`, `ReasoningContent`, and `ReasoningText` around the grouped children.
|
|
30
30
|
|
|
31
|
-
While reasoning is streaming, `part.status.type === "running"`. Pass that to `streaming` so the accordion auto-opens during streaming with a bottom-pinned live preview of the newest tokens,
|
|
31
|
+
While reasoning is streaming, `part.status.type === "running"`. Pass that to `streaming` so the accordion auto-opens during streaming with a bottom-pinned live preview of the newest tokens, and permanently defers to the first manual toggle. `streaming` only holds the disclosure open; when it ends the accordion returns to `defaultOpen`, which is `false` by default and therefore collapses. Pass `defaultOpen` to keep reasoning expanded once the run finishes.
|
|
32
32
|
|
|
33
33
|
```tsx title="/app/components/assistant-ui/thread.tsx"
|
|
34
34
|
import { MessagePrimitive, groupPartByType } from "@assistant-ui/react";
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
title: Select
|
|
3
3
|
description: A dropdown select component with composable sub-components.
|
|
4
4
|
links:
|
|
5
|
-
- label: Radix UI Select
|
|
5
|
+
- label: Radix UI Select (Radix styles)
|
|
6
6
|
url: https://www.radix-ui.com/primitives/docs/components/select
|
|
7
|
+
- label: Base UI Select (base styles)
|
|
8
|
+
url: https://base-ui.com/react/components/select
|
|
7
9
|
platforms: ["react"]
|
|
8
10
|
---
|
|
9
11
|
|
|
@@ -18,12 +20,16 @@ import {
|
|
|
18
20
|
SelectSizesSample,
|
|
19
21
|
SelectScrollableSample,
|
|
20
22
|
} from "@/components/docs/samples/select";
|
|
23
|
+
import * as SelectRadixSamples from "@/components/docs/samples/select.radix";
|
|
24
|
+
import { Flavored, FlavorSwitcher } from "@/components/docs/contexts/flavor.server";
|
|
21
25
|
|
|
22
26
|
<Callout>
|
|
23
27
|
This is a **standalone component** that does not depend on the assistant-ui runtime. Use it anywhere in your application.
|
|
24
28
|
</Callout>
|
|
25
29
|
|
|
26
|
-
<
|
|
30
|
+
<FlavorSwitcher />
|
|
31
|
+
|
|
32
|
+
<Flavored radix={<SelectRadixSamples.SelectSample />} base={<SelectSample />} />
|
|
27
33
|
|
|
28
34
|
## Installation
|
|
29
35
|
|
|
@@ -60,7 +66,7 @@ export function FruitPicker() {
|
|
|
60
66
|
|
|
61
67
|
Use the `variant` prop on `SelectTrigger` to change the visual style.
|
|
62
68
|
|
|
63
|
-
<SelectVariantsSample />
|
|
69
|
+
<Flavored radix={<SelectRadixSamples.SelectVariantsSample />} base={<SelectVariantsSample />} />
|
|
64
70
|
|
|
65
71
|
```tsx
|
|
66
72
|
<SelectTrigger variant="outline" /> // Border (default)
|
|
@@ -72,7 +78,7 @@ Use the `variant` prop on `SelectTrigger` to change the visual style.
|
|
|
72
78
|
|
|
73
79
|
Use the `size` prop on `SelectTrigger` to change the height.
|
|
74
80
|
|
|
75
|
-
<SelectSizesSample />
|
|
81
|
+
<Flavored radix={<SelectRadixSamples.SelectSizesSample />} base={<SelectSizesSample />} />
|
|
76
82
|
|
|
77
83
|
```tsx
|
|
78
84
|
<SelectTrigger size="default" /> // 36px (default)
|
|
@@ -83,34 +89,34 @@ Use the `size` prop on `SelectTrigger` to change the height.
|
|
|
83
89
|
|
|
84
90
|
Long lists automatically become scrollable.
|
|
85
91
|
|
|
86
|
-
<PreviewCode file="components/docs/samples/select" name="SelectScrollableSample">
|
|
87
|
-
<SelectScrollableSample />
|
|
92
|
+
<PreviewCode file="components/docs/samples/select" name="SelectScrollableSample" base={<SelectScrollableSample />}>
|
|
93
|
+
<SelectRadixSamples.SelectScrollableSample />
|
|
88
94
|
</PreviewCode>
|
|
89
95
|
|
|
90
96
|
### Groups
|
|
91
97
|
|
|
92
98
|
Use the composable API for grouped options:
|
|
93
99
|
|
|
94
|
-
<PreviewCode file="components/docs/samples/select" name="SelectGroupsSample">
|
|
95
|
-
<SelectGroupsSample />
|
|
100
|
+
<PreviewCode file="components/docs/samples/select" name="SelectGroupsSample" base={<SelectGroupsSample />}>
|
|
101
|
+
<SelectRadixSamples.SelectGroupsSample />
|
|
96
102
|
</PreviewCode>
|
|
97
103
|
|
|
98
104
|
### Disabled Items
|
|
99
105
|
|
|
100
|
-
<PreviewCode file="components/docs/samples/select" name="SelectDisabledItemsSample">
|
|
101
|
-
<SelectDisabledItemsSample />
|
|
106
|
+
<PreviewCode file="components/docs/samples/select" name="SelectDisabledItemsSample" base={<SelectDisabledItemsSample />}>
|
|
107
|
+
<SelectRadixSamples.SelectDisabledItemsSample />
|
|
102
108
|
</PreviewCode>
|
|
103
109
|
|
|
104
110
|
### With Placeholder
|
|
105
111
|
|
|
106
|
-
<PreviewCode file="components/docs/samples/select" name="SelectPlaceholderSample">
|
|
107
|
-
<SelectPlaceholderSample />
|
|
112
|
+
<PreviewCode file="components/docs/samples/select" name="SelectPlaceholderSample" base={<SelectPlaceholderSample />}>
|
|
113
|
+
<SelectRadixSamples.SelectPlaceholderSample />
|
|
108
114
|
</PreviewCode>
|
|
109
115
|
|
|
110
116
|
### Disabled Select
|
|
111
117
|
|
|
112
|
-
<PreviewCode file="components/docs/samples/select" name="SelectDisabledSample">
|
|
113
|
-
<SelectDisabledSample />
|
|
118
|
+
<PreviewCode file="components/docs/samples/select" name="SelectDisabledSample" base={<SelectDisabledSample />}>
|
|
119
|
+
<SelectRadixSamples.SelectDisabledSample />
|
|
114
120
|
</PreviewCode>
|
|
115
121
|
|
|
116
122
|
## API Reference
|
|
@@ -131,6 +137,8 @@ Use the composable API for grouped options:
|
|
|
131
137
|
| `SelectScrollUpButton` | Scroll indicator for long lists. |
|
|
132
138
|
| `SelectScrollDownButton` | Scroll indicator for long lists. |
|
|
133
139
|
|
|
140
|
+
With the Base UI flavor, `SelectValue` resolves the trigger label from the `items` prop on `SelectRoot`; pass the same array you map into `SelectItem` children. The Radix flavor reads the label from the selected item's text automatically.
|
|
141
|
+
|
|
134
142
|
### Select
|
|
135
143
|
|
|
136
144
|
A convenience component that renders a complete select with options.
|
|
@@ -109,7 +109,7 @@ Root container rendered as an `<a>` tag. Accepts all `<a>` props plus `variant`
|
|
|
109
109
|
| `size` | `"sm" \| "default" \| "lg"` | `"default"` | Size of the badge |
|
|
110
110
|
| `target` | `string` | `"_blank"` | Link target |
|
|
111
111
|
| `rel` | `string` | `"noopener noreferrer"` | Link rel attribute |
|
|
112
|
-
| `asChild` | `boolean` | `false` |
|
|
112
|
+
| `asChild` | `boolean` | `false` | Merge props with a child element instead of rendering an anchor. Effective with the Radix badge; the Base UI badge ignores it |
|
|
113
113
|
| `className` | `string` | — | Additional CSS classes |
|
|
114
114
|
|
|
115
115
|
### `SourceIcon`
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
title: Tabs
|
|
3
3
|
description: A multi-variant tabs component for organizing content into switchable panels.
|
|
4
4
|
links:
|
|
5
|
-
- label: Radix UI Tabs
|
|
5
|
+
- label: Radix UI Tabs (Radix styles)
|
|
6
6
|
url: https://www.radix-ui.com/primitives/docs/components/tabs
|
|
7
|
+
- label: Base UI Tabs (base styles)
|
|
8
|
+
url: https://base-ui.com/react/components/tabs
|
|
7
9
|
platforms: ["react"]
|
|
8
10
|
---
|
|
9
11
|
|
|
@@ -17,12 +19,16 @@ import {
|
|
|
17
19
|
TabsAsLinkSample,
|
|
18
20
|
TabsAnimatedIndicatorSample,
|
|
19
21
|
} from "@/components/docs/samples/tabs";
|
|
22
|
+
import * as TabsRadixSamples from "@/components/docs/samples/tabs.radix";
|
|
23
|
+
import { Flavored, FlavorSwitcher } from "@/components/docs/contexts/flavor.server";
|
|
20
24
|
|
|
21
25
|
<Callout>
|
|
22
26
|
This is a **standalone component** that does not depend on the assistant-ui runtime. Use it anywhere in your application.
|
|
23
27
|
</Callout>
|
|
24
28
|
|
|
25
|
-
<
|
|
29
|
+
<FlavorSwitcher />
|
|
30
|
+
|
|
31
|
+
<Flavored radix={<TabsRadixSamples.TabsSample />} base={<TabsSample />} />
|
|
26
32
|
|
|
27
33
|
## Installation
|
|
28
34
|
|
|
@@ -58,7 +64,7 @@ export function Example() {
|
|
|
58
64
|
|
|
59
65
|
Use the `variant` prop on `TabsList` to change the visual style. Child components inherit the variant automatically.
|
|
60
66
|
|
|
61
|
-
<TabsVariantsSample />
|
|
67
|
+
<Flavored radix={<TabsRadixSamples.TabsVariantsSample />} base={<TabsVariantsSample />} />
|
|
62
68
|
|
|
63
69
|
```tsx
|
|
64
70
|
<TabsList variant="default" /> // Muted background with shadow (default)
|
|
@@ -72,7 +78,7 @@ Use the `variant` prop on `TabsList` to change the visual style. Child component
|
|
|
72
78
|
|
|
73
79
|
Use the `size` prop on `TabsList` to change the tab height. Child components inherit the size automatically.
|
|
74
80
|
|
|
75
|
-
<TabsSizesSample />
|
|
81
|
+
<Flavored radix={<TabsRadixSamples.TabsSizesSample />} base={<TabsSizesSample />} />
|
|
76
82
|
|
|
77
83
|
```tsx
|
|
78
84
|
<TabsList size="sm" /> // 32px height
|
|
@@ -84,24 +90,24 @@ Use the `size` prop on `TabsList` to change the tab height. Child components inh
|
|
|
84
90
|
|
|
85
91
|
Tabs automatically style SVG icons placed inside triggers.
|
|
86
92
|
|
|
87
|
-
<PreviewCode file="components/docs/samples/tabs" name="TabsWithIconsSample">
|
|
88
|
-
<TabsWithIconsSample />
|
|
93
|
+
<PreviewCode file="components/docs/samples/tabs" name="TabsWithIconsSample" base={<TabsWithIconsSample />}>
|
|
94
|
+
<TabsRadixSamples.TabsWithIconsSample />
|
|
89
95
|
</PreviewCode>
|
|
90
96
|
|
|
91
97
|
### Controlled
|
|
92
98
|
|
|
93
99
|
Use `value` and `onValueChange` for controlled tab state.
|
|
94
100
|
|
|
95
|
-
<PreviewCode file="components/docs/samples/tabs" name="TabsControlledSample">
|
|
96
|
-
<TabsControlledSample />
|
|
101
|
+
<PreviewCode file="components/docs/samples/tabs" name="TabsControlledSample" base={<TabsControlledSample />}>
|
|
102
|
+
<TabsRadixSamples.TabsControlledSample />
|
|
97
103
|
</PreviewCode>
|
|
98
104
|
|
|
99
105
|
### As Link
|
|
100
106
|
|
|
101
|
-
|
|
107
|
+
Compose with `render` (Base UI) or `asChild` (Radix) on `TabsTrigger` to render as a different element, like a navigation link.
|
|
102
108
|
|
|
103
|
-
<PreviewCode file="components/docs/samples/tabs" name="TabsAsLinkSample">
|
|
104
|
-
<TabsAsLinkSample />
|
|
109
|
+
<PreviewCode file="components/docs/samples/tabs" name="TabsAsLinkSample" base={<TabsAsLinkSample />}>
|
|
110
|
+
<TabsRadixSamples.TabsAsLinkSample />
|
|
105
111
|
</PreviewCode>
|
|
106
112
|
|
|
107
113
|
### Animated Indicator
|
|
@@ -116,8 +122,8 @@ All variants feature smooth animated indicators that slide between tabs:
|
|
|
116
122
|
| `pills` | Sliding pill background |
|
|
117
123
|
| `outline` | Sliding border |
|
|
118
124
|
|
|
119
|
-
<PreviewCode file="components/docs/samples/tabs" name="TabsAnimatedIndicatorSample">
|
|
120
|
-
<TabsAnimatedIndicatorSample />
|
|
125
|
+
<PreviewCode file="components/docs/samples/tabs" name="TabsAnimatedIndicatorSample" base={<TabsAnimatedIndicatorSample />}>
|
|
126
|
+
<TabsRadixSamples.TabsAnimatedIndicatorSample />
|
|
121
127
|
</PreviewCode>
|
|
122
128
|
|
|
123
129
|
## API Reference
|
|
@@ -201,11 +207,16 @@ An individual tab button.
|
|
|
201
207
|
required: true,
|
|
202
208
|
description: "The unique value for this tab.",
|
|
203
209
|
},
|
|
210
|
+
{
|
|
211
|
+
name: "render",
|
|
212
|
+
type: "ReactElement | function",
|
|
213
|
+
description: "Base UI: compose as a different element instead of rendering a button.",
|
|
214
|
+
},
|
|
204
215
|
{
|
|
205
216
|
name: "asChild",
|
|
206
217
|
type: "boolean",
|
|
207
218
|
default: "false",
|
|
208
|
-
description: "
|
|
219
|
+
description: "Radix: merge props with a child element instead of rendering a button.",
|
|
209
220
|
},
|
|
210
221
|
{
|
|
211
222
|
name: "disabled",
|
|
@@ -20,9 +20,9 @@ import { HeatGraphDemo } from "@/app/(demos)/heat-graph/heat-graph-demo";
|
|
|
20
20
|
<Tabs items={["shadcn", "npm", "pnpm", "yarn"]}>
|
|
21
21
|
<Tab value="shadcn">
|
|
22
22
|
```sh
|
|
23
|
-
npx shadcn@latest add
|
|
23
|
+
npx shadcn@latest add @assistant-ui/heat-graph
|
|
24
24
|
```
|
|
25
|
-
This installs a pre-styled `HeatGraph` component to `components/assistant-ui/heat-graph.tsx` along with the `heat-graph` package.
|
|
25
|
+
This installs a pre-styled `HeatGraph` component to `components/assistant-ui/heat-graph.tsx` along with the `heat-graph` package. The `@assistant-ui` namespace resolves through the registry entry configured in [Manual Setup](/docs/installation#manual-setup).
|
|
26
26
|
</Tab>
|
|
27
27
|
<Tab value="npm">
|
|
28
28
|
```sh
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","names":[],"sources":["../src/constants.ts"],"mappings":";cAKa
|
|
1
|
+
{"version":3,"file":"constants.d.ts","names":[],"sources":["../src/constants.ts"],"mappings":";cAKa;cACA;cAEA;cAGA;cACA;cAEA;cACA;cAEA;cAEA;cAEA"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":";;cAsBa,QAAM;iBAqFG,aAAS"}
|
package/dist/index.js
CHANGED
|
@@ -3,10 +3,12 @@ import { logger } from "./utils/logger.js";
|
|
|
3
3
|
import { docsTools } from "./tools/docs.js";
|
|
4
4
|
import { examplesTools } from "./tools/examples.js";
|
|
5
5
|
import { searchTools } from "./tools/search.js";
|
|
6
|
+
import { xuluxTemplateDetailsTool, xuluxTemplatePreviewTool, xuluxTemplatesListTool } from "./tools/xulux-templates.js";
|
|
7
|
+
import { xuluxPlaygroundPrompt } from "./prompts/xulux-playground.js";
|
|
6
8
|
import { registerResources } from "./tools/resources.js";
|
|
7
9
|
import { join } from "node:path";
|
|
8
|
-
import { McpServer } from "@modelcontextprotocol/
|
|
9
|
-
import { StdioServerTransport } from "@modelcontextprotocol/
|
|
10
|
+
import { McpServer } from "@modelcontextprotocol/server";
|
|
11
|
+
import { StdioServerTransport } from "@modelcontextprotocol/server/stdio";
|
|
10
12
|
import { readFileSync } from "node:fs";
|
|
11
13
|
//#region src/index.ts
|
|
12
14
|
const packageJson = JSON.parse(readFileSync(join(PACKAGE_DIR, "package.json"), "utf-8"));
|
|
@@ -41,6 +43,43 @@ server.registerTool(searchTools.name, {
|
|
|
41
43
|
openWorldHint: false
|
|
42
44
|
}
|
|
43
45
|
}, searchTools.execute);
|
|
46
|
+
server.registerTool(xuluxTemplatesListTool.name, {
|
|
47
|
+
title: "assistant-ui Templates",
|
|
48
|
+
description: xuluxTemplatesListTool.description,
|
|
49
|
+
inputSchema: xuluxTemplatesListTool.parameters,
|
|
50
|
+
annotations: {
|
|
51
|
+
readOnlyHint: true,
|
|
52
|
+
openWorldHint: true
|
|
53
|
+
}
|
|
54
|
+
}, xuluxTemplatesListTool.execute);
|
|
55
|
+
server.registerTool(xuluxTemplateDetailsTool.name, {
|
|
56
|
+
title: "assistant-ui Template Details",
|
|
57
|
+
description: xuluxTemplateDetailsTool.description,
|
|
58
|
+
inputSchema: xuluxTemplateDetailsTool.parameters,
|
|
59
|
+
annotations: {
|
|
60
|
+
readOnlyHint: true,
|
|
61
|
+
openWorldHint: true
|
|
62
|
+
}
|
|
63
|
+
}, xuluxTemplateDetailsTool.execute);
|
|
64
|
+
server.registerTool(xuluxTemplatePreviewTool.name, {
|
|
65
|
+
title: "assistant-ui Template Preview URLs",
|
|
66
|
+
description: xuluxTemplatePreviewTool.description,
|
|
67
|
+
inputSchema: xuluxTemplatePreviewTool.parameters,
|
|
68
|
+
annotations: {
|
|
69
|
+
readOnlyHint: false,
|
|
70
|
+
openWorldHint: true
|
|
71
|
+
}
|
|
72
|
+
}, xuluxTemplatePreviewTool.execute);
|
|
73
|
+
server.registerPrompt(xuluxPlaygroundPrompt.name, {
|
|
74
|
+
title: "assistant-ui Template Workflow",
|
|
75
|
+
description: xuluxPlaygroundPrompt.description
|
|
76
|
+
}, () => ({ messages: [{
|
|
77
|
+
role: "user",
|
|
78
|
+
content: {
|
|
79
|
+
type: "text",
|
|
80
|
+
text: xuluxPlaygroundPrompt.text
|
|
81
|
+
}
|
|
82
|
+
}] }));
|
|
44
83
|
registerResources(server);
|
|
45
84
|
async function runServer() {
|
|
46
85
|
try {
|