@assistant-ui/mcp-docs-server 0.1.38 → 0.1.39
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 +8 -9
- package/.docs/organized/code-examples/with-a2a.md +16 -11
- package/.docs/organized/code-examples/with-ag-ui.md +16 -11
- package/.docs/organized/code-examples/{with-ai-sdk-v6.md → with-ai-sdk-v7.md} +32 -21
- package/.docs/organized/code-examples/with-artifacts.md +17 -10
- package/.docs/organized/code-examples/with-assistant-transport.md +15 -8
- package/.docs/organized/code-examples/with-browser-extension.md +15 -8
- package/.docs/organized/code-examples/with-chain-of-thought.md +17 -10
- package/.docs/organized/code-examples/with-cloud-standalone.md +10 -9
- package/.docs/organized/code-examples/with-cloud.md +18 -13
- package/.docs/organized/code-examples/with-custom-thread-list.md +17 -10
- package/.docs/organized/code-examples/with-elevenlabs-conversational.md +20 -13
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +20 -13
- package/.docs/organized/code-examples/with-eve.md +16 -9
- package/.docs/organized/code-examples/with-expo.md +27 -24
- package/.docs/organized/code-examples/with-external-store.md +16 -11
- package/.docs/organized/code-examples/with-ffmpeg.md +18 -13
- package/.docs/organized/code-examples/with-generative-ui.md +20 -15
- package/.docs/organized/code-examples/with-google-adk.md +15 -8
- package/.docs/organized/code-examples/with-heat-graph.md +8 -9
- package/.docs/organized/code-examples/with-image-generation.md +17 -10
- package/.docs/organized/code-examples/with-interactables.md +19 -15
- package/.docs/organized/code-examples/with-langchain.md +17 -10
- package/.docs/organized/code-examples/with-langgraph.md +17 -10
- package/.docs/organized/code-examples/with-livekit.md +21 -14
- package/.docs/organized/code-examples/with-mcp.md +25 -12
- package/.docs/organized/code-examples/with-opencode.md +22 -17
- package/.docs/organized/code-examples/with-pi.md +47 -12
- package/.docs/organized/code-examples/with-react-hook-form.md +19 -14
- package/.docs/organized/code-examples/with-react-ink-web.md +6 -6
- package/.docs/organized/code-examples/with-react-ink.md +2 -2
- package/.docs/organized/code-examples/with-react-router.md +20 -15
- package/.docs/organized/code-examples/with-resumable-stream.md +19 -12
- package/.docs/organized/code-examples/with-store.md +8 -9
- package/.docs/organized/code-examples/with-tanstack.md +16 -10
- package/.docs/organized/code-examples/with-tap-runtime.md +16 -11
- package/.docs/organized/code-examples/with-virtualized-thread.md +17 -12
- package/.docs/raw/docs/(docs)/base-ui.mdx +39 -0
- package/.docs/raw/docs/(docs)/cli.mdx +17 -1
- 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/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 +19 -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/integrations/index.mdx +4 -1
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-ai-sdk.mdx +4 -2
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-data-stream.mdx +37 -0
- package/.docs/raw/docs/(reference)/api-reference/overview.mdx +1 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-if.mdx +29 -29
- 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 +3 -1
- package/.docs/raw/docs/guides/chatgpt-subscription.mdx +108 -0
- package/.docs/raw/docs/guides/dictation.mdx +185 -257
- package/.docs/raw/docs/guides/index.mdx +10 -0
- package/.docs/raw/docs/guides/mentions.mdx +31 -3
- 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/primitives.mdx +35 -1
- 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 +1 -1
- package/.docs/raw/docs/migrations/index.mdx +50 -0
- package/.docs/raw/docs/migrations/toolkit-tools.mdx +4 -2
- package/.docs/raw/docs/primitives/chain-of-thought.mdx +6 -1
- package/.docs/raw/docs/primitives/composer.mdx +16 -0
- package/.docs/raw/docs/primitives/selection-toolbar.mdx +25 -0
- package/.docs/raw/docs/react-native/primitives.mdx +23 -0
- 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 +13 -4
- package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +11 -11
- package/.docs/raw/docs/runtimes/ai-sdk/v5-legacy.mdx +5 -5
- package/.docs/raw/docs/runtimes/ai-sdk/{v6.mdx → v6-legacy.mdx} +8 -6
- 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/custom/data-stream.mdx +10 -19
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +1 -1
- package/.docs/raw/docs/runtimes/custom/local-runtime.mdx +2 -0
- package/.docs/raw/docs/runtimes/eve/overview.mdx +1 -1
- package/.docs/raw/docs/runtimes/langgraph/agent-state.mdx +181 -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/mcp-apps.mdx +29 -11
- 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 +26 -3
- 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 +2 -2
- package/.docs/raw/docs/ui/model-selector.mdx +32 -2
- 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 +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -1
- package/dist/prepare-docs/code-examples.d.ts.map +1 -1
- package/dist/prepare-docs/copy-raw.d.ts.map +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/tools/docs.d.ts +2 -4
- package/dist/tools/docs.d.ts.map +1 -1
- package/dist/tools/docs.js +24 -8
- package/dist/tools/docs.js.map +1 -1
- package/dist/tools/examples.d.ts +2 -4
- package/dist/tools/examples.d.ts.map +1 -1
- package/dist/tools/examples.js +9 -6
- package/dist/tools/examples.js.map +1 -1
- package/dist/tools/resources.d.ts +0 -1
- package/dist/tools/resources.d.ts.map +1 -1
- package/dist/tools/search.d.ts +2 -5
- package/dist/tools/search.d.ts.map +1 -1
- 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 +72 -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/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 +5 -5
- package/src/index.ts +53 -0
- package/src/prompts/xulux-playground.ts +36 -0
- package/src/tools/docs.ts +25 -3
- package/src/tools/examples.ts +15 -10
- package/src/tools/tests/docs.test.ts +20 -0
- package/src/tools/tests/examples.test.ts +5 -5
- package/src/tools/tests/listings-cache.test.ts +19 -0
- package/src/tools/tests/mcp-protocol.test.ts +81 -1
- 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
|
@@ -74,7 +74,7 @@ import { useChatRuntime } from "@assistant-ui/react-ai-sdk";
|
|
|
74
74
|
import toolkit from "./toolkit";
|
|
75
75
|
|
|
76
76
|
function MyRuntimeProvider({ children }: { children: React.ReactNode }) {
|
|
77
|
-
const runtime = useChatRuntime(
|
|
77
|
+
const runtime = useChatRuntime();
|
|
78
78
|
const aui = useAui({ tools: Tools({ toolkit }) });
|
|
79
79
|
return (
|
|
80
80
|
<AssistantRuntimeProvider aui={aui} runtime={runtime}>
|
|
@@ -84,6 +84,8 @@ function MyRuntimeProvider({ children }: { children: React.ReactNode }) {
|
|
|
84
84
|
}
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
+
`useChatRuntime()` targets `/api/chat` by default. To point at a different endpoint or customize requests, see [Custom transport](/docs/runtimes/ai-sdk/v7#custom-transport).
|
|
88
|
+
|
|
87
89
|
<Callout type="tip">
|
|
88
90
|
Frontend toolkit entries can be passed to your backend using the
|
|
89
91
|
`frontendTools` utility.
|
|
@@ -537,7 +539,7 @@ export default defineToolkit({
|
|
|
537
539
|
|
|
538
540
|
### Server-side approval gates
|
|
539
541
|
|
|
540
|
-
Some runtimes (notably AI SDK
|
|
542
|
+
Some runtimes (notably AI SDK v7's `toolApproval`-gated tools) pause on the server and emit an approval request that the client must acknowledge before the tool runs. assistant-ui surfaces this on the tool part as `approval` and exposes `respondToApproval({ approved, reason? })` on the renderer:
|
|
541
543
|
|
|
542
544
|
```tsx
|
|
543
545
|
const toolkit = defineToolkit({
|
|
@@ -581,9 +583,9 @@ const toolkit = defineToolkit({
|
|
|
581
583
|
|
|
582
584
|
`approval.isAutomatic` is `true` when the runtime granted the decision from a server-side policy rather than the user; render a "auto-approved" badge instead of buttons in that case.
|
|
583
585
|
|
|
584
|
-
Approval gates require a runtime that implements them: the AI SDK
|
|
586
|
+
Approval gates require a runtime that implements them: the AI SDK v7 runtime emits them for `toolApproval`-gated tools, and `LocalRuntime` supports gates emitted by your `ChatModelAdapter`; see [LocalRuntime approval gates](/docs/runtimes/custom/local-runtime#approval-gates). For tools where the user supplies the result itself, use `unstable_humanToolNames` with `addResult` instead; see [human-in-the-loop tools](/docs/runtimes/custom/local-runtime#human-in-the-loop-tools).
|
|
585
587
|
|
|
586
|
-
For the wire-side setup (`needsApproval`, `sendAutomaticallyWhen`), see [AI SDK
|
|
588
|
+
For the wire-side setup (`needsApproval`, `sendAutomaticallyWhen`), see [AI SDK v7 server-side tool approval](/docs/runtimes/ai-sdk/v7#server-side-tool-approval).
|
|
587
589
|
|
|
588
590
|
### Approval options
|
|
589
591
|
|
|
@@ -221,14 +221,13 @@ import { useChatRuntime } from "@assistant-ui/react-ai-sdk";
|
|
|
221
221
|
|
|
222
222
|
export function Chat() {
|
|
223
223
|
const runtime = useChatRuntime({
|
|
224
|
-
api: "/api/chat",
|
|
225
224
|
sendAutomaticallyWhen: lastAssistantMessageIsCompleteWithToolCalls,
|
|
226
225
|
});
|
|
227
226
|
/* … */
|
|
228
227
|
}
|
|
229
228
|
```
|
|
230
229
|
|
|
231
|
-
`sendAutomaticallyWhen` sends completed frontend tool results back to the server so the model can continue after a tool call.
|
|
230
|
+
`sendAutomaticallyWhen` sends completed frontend tool results back to the server so the model can continue after a tool call. `useChatRuntime()` targets `/api/chat` by default; to point at a different endpoint, see [Custom transport](/docs/runtimes/ai-sdk/v7#custom-transport).
|
|
232
231
|
|
|
233
232
|
Tool names are prefixed `serverId__toolName` to avoid collisions across connected servers. The toolkit re-registers whenever a server connects / disconnects or its tool list changes.
|
|
234
233
|
|
|
@@ -316,6 +315,29 @@ const aui = useAui();
|
|
|
316
315
|
await aui.mcp().addCustomServer({ name, url, auth: { type: "bearer", token } });
|
|
317
316
|
await aui.mcp().server({ id }).connect();
|
|
318
317
|
await aui.mcp().server({ id }).callTool("echo", { text: "hi" });
|
|
318
|
+
|
|
319
|
+
// Build a paginated resource browser/preview UI.
|
|
320
|
+
type ResourcePage = {
|
|
321
|
+
resources: Array<{ uri: string; name?: string }>;
|
|
322
|
+
nextCursor?: string;
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
const server = aui.mcp().server({ id });
|
|
326
|
+
const resources: ResourcePage["resources"] = [];
|
|
327
|
+
let nextCursor: string | undefined;
|
|
328
|
+
|
|
329
|
+
do {
|
|
330
|
+
const page = (await (nextCursor === undefined
|
|
331
|
+
? server.listResources()
|
|
332
|
+
: server.listResources({ cursor: nextCursor }))) as ResourcePage;
|
|
333
|
+
resources.push(...page.resources);
|
|
334
|
+
nextCursor = page.nextCursor;
|
|
335
|
+
} while (nextCursor !== undefined);
|
|
336
|
+
|
|
337
|
+
const firstResource = resources[0];
|
|
338
|
+
if (firstResource) {
|
|
339
|
+
const preview = await server.readResource(firstResource.uri);
|
|
340
|
+
}
|
|
319
341
|
```
|
|
320
342
|
|
|
321
343
|
## v1 scope
|
|
@@ -323,13 +345,14 @@ await aui.mcp().server({ id }).callTool("echo", { text: "hi" });
|
|
|
323
345
|
What ships:
|
|
324
346
|
|
|
325
347
|
- Tool listing and invocation, auto-registered as frontend tools
|
|
348
|
+
- Resource listing and reads for app-built browsers or preview panes
|
|
326
349
|
- OAuth (PKCE + DCR), bearer, none
|
|
327
350
|
- StreamableHTTP transport
|
|
328
351
|
- Manual connect/disconnect
|
|
329
352
|
|
|
330
353
|
What's deferred:
|
|
331
354
|
|
|
332
|
-
-
|
|
355
|
+
- Prompts, sampling
|
|
333
356
|
- Auto-reconnect with backoff
|
|
334
357
|
- Per-tool enable/disable persistence
|
|
335
358
|
- Per-tool consent prompts
|
|
@@ -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,7 @@ 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
76
|
|
|
77
77
|
## Related Components
|
|
78
78
|
|
|
@@ -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.
|
|
@@ -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",
|
|
@@ -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"}
|