@assistant-ui/mcp-docs-server 0.2.2 → 0.2.3
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 +2 -2
- package/.docs/organized/code-examples/with-a2a.md +4 -3
- package/.docs/organized/code-examples/with-ag-ui.md +5 -4
- package/.docs/organized/code-examples/with-ai-sdk-v7.md +12 -11
- package/.docs/organized/code-examples/with-artifacts.md +10 -9
- package/.docs/organized/code-examples/with-assistant-transport.md +4 -3
- package/.docs/organized/code-examples/with-browser-extension.md +3 -3
- package/.docs/organized/code-examples/with-chain-of-thought.md +14 -12
- package/.docs/organized/code-examples/with-cloud-standalone.md +5 -5
- package/.docs/organized/code-examples/with-cloud.md +9 -8
- package/.docs/organized/code-examples/with-custom-thread-list.md +8 -7
- package/.docs/organized/code-examples/with-elevenlabs-conversational.md +12 -11
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +12 -11
- package/.docs/organized/code-examples/with-eve.md +5 -4
- package/.docs/organized/code-examples/with-expo.md +214 -31
- package/.docs/organized/code-examples/with-external-store.md +4 -3
- package/.docs/organized/code-examples/with-ffmpeg.md +9 -8
- package/.docs/organized/code-examples/with-generative-ui.md +13 -15
- package/.docs/organized/code-examples/with-google-adk.md +4 -3
- package/.docs/organized/code-examples/with-heat-graph.md +2 -2
- package/.docs/organized/code-examples/with-image-generation.md +7 -6
- package/.docs/organized/code-examples/with-interactables.md +9 -8
- package/.docs/organized/code-examples/with-langchain.md +6 -5
- package/.docs/organized/code-examples/with-langgraph.md +6 -5
- package/.docs/organized/code-examples/with-livekit.md +13 -12
- package/.docs/organized/code-examples/with-mcp.md +11 -9
- package/.docs/organized/code-examples/with-nuxt.md +502 -502
- package/.docs/organized/code-examples/with-opencode.md +3 -3
- package/.docs/organized/code-examples/with-openui.md +14 -13
- package/.docs/organized/code-examples/with-pi.md +5 -4
- package/.docs/organized/code-examples/with-react-hook-form.md +13 -10
- package/.docs/organized/code-examples/with-react-ink-web.md +64 -14
- package/.docs/organized/code-examples/with-react-ink.md +3 -2
- package/.docs/organized/code-examples/with-react-router.md +6 -5
- package/.docs/organized/code-examples/with-resumable-stream.md +10 -9
- package/.docs/organized/code-examples/with-store.md +2 -2
- package/.docs/organized/code-examples/with-svelte.md +3 -3
- package/.docs/organized/code-examples/with-sveltekit.md +9 -9
- package/.docs/organized/code-examples/with-tanstack.md +8 -7
- package/.docs/organized/code-examples/with-tap-runtime.md +4 -3
- package/.docs/organized/code-examples/with-virtualized-thread.md +5 -4
- package/.docs/organized/code-examples/with-vue.md +2 -2
- package/.docs/raw/docs/{(docs) → (getting-started)}/devtools.mdx +1 -1
- package/.docs/raw/docs/{(docs) → (getting-started)}/index.mdx +4 -2
- package/.docs/raw/docs/{(docs) → (getting-started)}/installation.mdx +24 -24
- package/.docs/raw/docs/(reference)/api-reference/adapters/suggestions.mdx +6 -0
- package/.docs/raw/docs/(reference)/api-reference/context-providers/assistant-runtime-provider.mdx +1 -1
- package/.docs/raw/docs/(reference)/api-reference/external-store/message-conversion.mdx +6 -1
- package/.docs/raw/docs/(reference)/api-reference/integrations/{react-ai-sdk.mdx → ai-sdk.mdx} +19 -19
- package/.docs/raw/docs/(reference)/api-reference/integrations/eve.mdx +22 -1
- package/.docs/raw/docs/(reference)/api-reference/integrations/index.mdx +3 -3
- package/.docs/raw/docs/(reference)/api-reference/overview.mdx +2 -2
- package/.docs/raw/docs/(reference)/api-reference/primitives/composer.mdx +20 -2
- package/.docs/raw/docs/(reference)/api-reference/tools/interactables.mdx +1 -1
- package/.docs/raw/docs/(reference)/api-reference/transport/frame.mdx +1 -1
- package/.docs/raw/docs/(reference)/api-reference/utilities/miscellaneous.mdx +3 -0
- package/.docs/raw/docs/cloud/ai-sdk-assistant-ui.mdx +10 -10
- package/.docs/raw/docs/cloud/ai-sdk.mdx +2 -0
- package/.docs/raw/docs/copilots/assistant-frame.mdx +19 -8
- package/.docs/raw/docs/guides/attachments.mdx +2 -2
- package/.docs/raw/docs/guides/branching.mdx +1 -1
- package/.docs/raw/docs/guides/chatgpt-subscription.mdx +1 -1
- package/.docs/raw/docs/guides/dictation.mdx +1 -1
- package/.docs/raw/docs/guides/electron.mdx +1 -1
- package/.docs/raw/docs/guides/latex.mdx +1 -1
- package/.docs/raw/docs/guides/message-timing.mdx +11 -5
- package/.docs/raw/docs/guides/quoting.mdx +1 -1
- package/.docs/raw/docs/guides/resumable-streams.mdx +3 -3
- package/.docs/raw/docs/guides/speech.mdx +1 -1
- package/.docs/raw/docs/guides/suggestions.mdx +2 -2
- package/.docs/raw/docs/guides/voice.mdx +1 -1
- package/.docs/raw/docs/ink/hooks.mdx +1 -1
- package/.docs/raw/docs/ink/index.mdx +3 -2
- package/.docs/raw/docs/ink/migration.mdx +1 -1
- package/.docs/raw/docs/integrations/attachments/custom-adapter.mdx +3 -3
- package/.docs/raw/docs/integrations/frameworks/ai-sdk.mdx +3 -3
- package/.docs/raw/docs/integrations/frameworks/{cloudflare-agents/overview.mdx → cloudflare-agents.mdx} +4 -3
- package/.docs/raw/docs/integrations/frameworks/mastra/overview.mdx +1 -1
- package/.docs/raw/docs/integrations/frameworks/mastra/separate-server.mdx +1 -1
- package/.docs/raw/docs/integrations/index.mdx +2 -2
- package/.docs/raw/docs/integrations/persistence/custom-adapter.mdx +3 -3
- package/.docs/raw/docs/migrations/toolkit-tools.mdx +2 -2
- package/.docs/raw/docs/primitives/action-bar.mdx +1 -1
- package/.docs/raw/docs/primitives/assistant-modal.mdx +1 -1
- package/.docs/raw/docs/primitives/attachment.mdx +1 -1
- package/.docs/raw/docs/primitives/branch-picker.mdx +1 -1
- package/.docs/raw/docs/primitives/chain-of-thought.mdx +3 -3
- package/.docs/raw/docs/primitives/composer.mdx +1 -1
- package/.docs/raw/docs/primitives/error.mdx +1 -1
- package/.docs/raw/docs/primitives/message.mdx +1 -1
- package/.docs/raw/docs/primitives/selection-toolbar.mdx +1 -1
- package/.docs/raw/docs/primitives/suggestion.mdx +1 -1
- package/.docs/raw/docs/primitives/thread-list.mdx +1 -1
- package/.docs/raw/docs/primitives/thread.mdx +1 -1
- package/.docs/raw/docs/react-native/adapters.mdx +1 -1
- package/.docs/raw/docs/react-native/index.mdx +2 -2
- package/.docs/raw/docs/react-native/migration.mdx +2 -2
- package/.docs/raw/docs/react-native/primitives.mdx +142 -5
- package/.docs/raw/docs/runtimes/ag-ui/runtime-options.mdx +13 -1
- package/.docs/raw/docs/runtimes/ai-sdk/overview.mdx +3 -3
- package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +4 -4
- package/.docs/raw/docs/runtimes/ai-sdk/v7.mdx +31 -16
- package/.docs/raw/docs/runtimes/concepts/adapters.mdx +3 -3
- package/.docs/raw/docs/runtimes/concepts/architecture.mdx +3 -3
- package/.docs/raw/docs/runtimes/concepts/threads.mdx +5 -5
- package/.docs/raw/docs/runtimes/langchain.mdx +1 -1
- package/.docs/raw/docs/runtimes/opencode/quickstart.mdx +1 -1
- package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +1 -1
- package/.docs/raw/docs/tools/backend.mdx +4 -4
- package/.docs/raw/docs/tools/defining-tools.mdx +2 -2
- package/.docs/raw/docs/tools/generative-ui.mdx +2 -2
- package/.docs/raw/docs/tools/interactables.mdx +3 -3
- package/.docs/raw/docs/tools/mcp-apps.mdx +18 -1
- package/.docs/raw/docs/tools/mcp.mdx +2 -2
- package/.docs/raw/docs/tools/openui.mdx +2 -2
- package/.docs/raw/docs/tools/tool-ui.mdx +17 -5
- package/.docs/raw/docs/tools/user-managed-mcp.mdx +2 -2
- package/.docs/raw/docs/ui/assistant-modal.mdx +3 -3
- package/.docs/raw/docs/ui/assistant-sidebar.mdx +1 -1
- package/.docs/raw/docs/ui/attachment.mdx +30 -10
- package/.docs/raw/docs/ui/composer-trigger-popover.mdx +36 -1
- package/.docs/raw/docs/ui/context-display.mdx +1 -1
- package/.docs/raw/docs/ui/directive-text.mdx +1 -1
- package/.docs/raw/docs/ui/file.mdx +1 -1
- package/.docs/raw/docs/ui/follow-up-suggestions.mdx +1 -1
- package/.docs/raw/docs/ui/image.mdx +1 -1
- package/.docs/raw/docs/ui/markdown.mdx +40 -1
- package/.docs/raw/docs/ui/mermaid.mdx +1 -1
- package/.docs/raw/docs/ui/message-timing.mdx +1 -1
- package/.docs/raw/docs/ui/model-selector.mdx +4 -4
- package/.docs/raw/docs/ui/part-grouping.mdx +1 -1
- package/.docs/raw/docs/ui/quote.mdx +3 -3
- package/.docs/raw/docs/ui/reasoning.mdx +31 -3
- package/.docs/raw/docs/ui/scrollbar.mdx +1 -1
- package/.docs/raw/docs/ui/sources.mdx +10 -1
- package/.docs/raw/docs/ui/streamdown.mdx +2 -2
- package/.docs/raw/docs/ui/syntax-highlighting.mdx +1 -1
- package/.docs/raw/docs/ui/thread-list.mdx +40 -1
- package/.docs/raw/docs/ui/thread.mdx +49 -2
- package/.docs/raw/docs/ui/tool-fallback.mdx +23 -9
- package/.docs/raw/docs/ui/tool-group.mdx +1 -1
- package/.docs/raw/docs/ui/voice.mdx +1 -1
- package/.docs/raw/docs/utilities/react-o11y.mdx +2 -2
- package/dist/xulux/catalog-client.d.ts.map +1 -1
- package/dist/xulux/catalog-client.js +51 -6
- package/dist/xulux/catalog-client.js.map +1 -1
- package/dist/xulux/types.d.ts +7 -7
- package/dist/xulux/types.d.ts.map +1 -1
- package/dist/xulux/types.js.map +1 -1
- package/package.json +3 -3
- package/src/tools/tests/docs.test.ts +10 -7
- package/src/tools/tests/path-traversal.test.ts +5 -2
- package/src/tools/tests/xulux-templates.test.ts +63 -0
- package/src/xulux/catalog-client.ts +68 -23
- package/src/xulux/types.ts +17 -13
- package/.docs/raw/docs/ui/accordion.mdx +0 -266
- package/.docs/raw/docs/ui/badge.mdx +0 -150
- package/.docs/raw/docs/ui/diff-viewer.mdx +0 -280
- package/.docs/raw/docs/ui/dot-matrix.mdx +0 -133
- package/.docs/raw/docs/ui/number-roll.mdx +0 -154
- package/.docs/raw/docs/ui/select.mdx +0 -254
- package/.docs/raw/docs/ui/tabs.mdx +0 -271
- /package/.docs/raw/docs/{(docs) → (getting-started)}/architecture.mdx +0 -0
- /package/.docs/raw/docs/{(docs) → (getting-started)}/base-ui.mdx +0 -0
- /package/.docs/raw/docs/{(docs) → (getting-started)}/cli.mdx +0 -0
- /package/.docs/raw/docs/{(docs) → (getting-started)}/llm.mdx +0 -0
- /package/.docs/raw/docs/{(docs) → (getting-started)}/rtl.mdx +0 -0
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Select
|
|
3
|
-
description: A dropdown select component with composable sub-components.
|
|
4
|
-
links:
|
|
5
|
-
- label: Radix UI Select (Radix styles)
|
|
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
|
|
9
|
-
platforms: ["react"]
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
import { PreviewCode } from "@/components/docs/preview-code.server";
|
|
13
|
-
import {
|
|
14
|
-
SelectSample,
|
|
15
|
-
SelectDisabledItemsSample,
|
|
16
|
-
SelectPlaceholderSample,
|
|
17
|
-
SelectDisabledSample,
|
|
18
|
-
SelectGroupsSample,
|
|
19
|
-
SelectVariantsSample,
|
|
20
|
-
SelectSizesSample,
|
|
21
|
-
SelectScrollableSample,
|
|
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";
|
|
25
|
-
|
|
26
|
-
<Callout>
|
|
27
|
-
This is a **standalone component** that does not depend on the assistant-ui runtime. Use it anywhere in your application.
|
|
28
|
-
</Callout>
|
|
29
|
-
|
|
30
|
-
<FlavorSwitcher />
|
|
31
|
-
|
|
32
|
-
<Flavored radix={<SelectRadixSamples.SelectSample />} base={<SelectSample />} />
|
|
33
|
-
|
|
34
|
-
## Installation
|
|
35
|
-
|
|
36
|
-
<InstallCommand shadcn={["select"]} />
|
|
37
|
-
|
|
38
|
-
## Usage
|
|
39
|
-
|
|
40
|
-
```tsx
|
|
41
|
-
import { Select } from "@/components/assistant-ui/select";
|
|
42
|
-
|
|
43
|
-
const options = [
|
|
44
|
-
{ value: "apple", label: "Apple" },
|
|
45
|
-
{ value: "banana", label: "Banana" },
|
|
46
|
-
{ value: "orange", label: "Orange" },
|
|
47
|
-
];
|
|
48
|
-
|
|
49
|
-
export function FruitPicker() {
|
|
50
|
-
const [value, setValue] = useState("apple");
|
|
51
|
-
|
|
52
|
-
return (
|
|
53
|
-
<Select
|
|
54
|
-
value={value}
|
|
55
|
-
onValueChange={setValue}
|
|
56
|
-
options={options}
|
|
57
|
-
placeholder="Select a fruit..."
|
|
58
|
-
/>
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
## Examples
|
|
64
|
-
|
|
65
|
-
### Variants
|
|
66
|
-
|
|
67
|
-
Use the `variant` prop on `SelectTrigger` to change the visual style.
|
|
68
|
-
|
|
69
|
-
<Flavored radix={<SelectRadixSamples.SelectVariantsSample />} base={<SelectVariantsSample />} />
|
|
70
|
-
|
|
71
|
-
```tsx
|
|
72
|
-
<SelectTrigger variant="outline" /> // Border (default)
|
|
73
|
-
<SelectTrigger variant="ghost" /> // No border
|
|
74
|
-
<SelectTrigger variant="muted" /> // Solid background
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
### Sizes
|
|
78
|
-
|
|
79
|
-
Use the `size` prop on `SelectTrigger` to change the height.
|
|
80
|
-
|
|
81
|
-
<Flavored radix={<SelectRadixSamples.SelectSizesSample />} base={<SelectSizesSample />} />
|
|
82
|
-
|
|
83
|
-
```tsx
|
|
84
|
-
<SelectTrigger size="default" /> // 36px (default)
|
|
85
|
-
<SelectTrigger size="sm" /> // 32px
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
### Scrollable
|
|
89
|
-
|
|
90
|
-
Long lists automatically become scrollable.
|
|
91
|
-
|
|
92
|
-
<PreviewCode file="components/docs/samples/select" name="SelectScrollableSample" base={<SelectScrollableSample />}>
|
|
93
|
-
<SelectRadixSamples.SelectScrollableSample />
|
|
94
|
-
</PreviewCode>
|
|
95
|
-
|
|
96
|
-
### Groups
|
|
97
|
-
|
|
98
|
-
Use the composable API for grouped options:
|
|
99
|
-
|
|
100
|
-
<PreviewCode file="components/docs/samples/select" name="SelectGroupsSample" base={<SelectGroupsSample />}>
|
|
101
|
-
<SelectRadixSamples.SelectGroupsSample />
|
|
102
|
-
</PreviewCode>
|
|
103
|
-
|
|
104
|
-
### Disabled Items
|
|
105
|
-
|
|
106
|
-
<PreviewCode file="components/docs/samples/select" name="SelectDisabledItemsSample" base={<SelectDisabledItemsSample />}>
|
|
107
|
-
<SelectRadixSamples.SelectDisabledItemsSample />
|
|
108
|
-
</PreviewCode>
|
|
109
|
-
|
|
110
|
-
### With Placeholder
|
|
111
|
-
|
|
112
|
-
<PreviewCode file="components/docs/samples/select" name="SelectPlaceholderSample" base={<SelectPlaceholderSample />}>
|
|
113
|
-
<SelectRadixSamples.SelectPlaceholderSample />
|
|
114
|
-
</PreviewCode>
|
|
115
|
-
|
|
116
|
-
### Disabled Select
|
|
117
|
-
|
|
118
|
-
<PreviewCode file="components/docs/samples/select" name="SelectDisabledSample" base={<SelectDisabledSample />}>
|
|
119
|
-
<SelectRadixSamples.SelectDisabledSample />
|
|
120
|
-
</PreviewCode>
|
|
121
|
-
|
|
122
|
-
## API Reference
|
|
123
|
-
|
|
124
|
-
### Composable API
|
|
125
|
-
|
|
126
|
-
| Component | Description |
|
|
127
|
-
|-----------|-------------|
|
|
128
|
-
| `Select` | A convenience component that renders a complete select with options. |
|
|
129
|
-
| `SelectRoot` | The root component that manages state. |
|
|
130
|
-
| `SelectTrigger` | The button that opens the dropdown. Accepts `variant` and `size` props. |
|
|
131
|
-
| `SelectValue` | Renders the selected value or placeholder. |
|
|
132
|
-
| `SelectContent` | The dropdown content container with animations. |
|
|
133
|
-
| `SelectItem` | An individual selectable item. |
|
|
134
|
-
| `SelectGroup` | Groups related items together. |
|
|
135
|
-
| `SelectLabel` | A label for a group of items. |
|
|
136
|
-
| `SelectSeparator` | A visual separator between items or groups. |
|
|
137
|
-
| `SelectScrollUpButton` | Scroll indicator for long lists. |
|
|
138
|
-
| `SelectScrollDownButton` | Scroll indicator for long lists. |
|
|
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
|
-
|
|
142
|
-
### Select
|
|
143
|
-
|
|
144
|
-
A convenience component that renders a complete select with options.
|
|
145
|
-
|
|
146
|
-
<ParametersTable
|
|
147
|
-
type="SelectProps"
|
|
148
|
-
parameters={[
|
|
149
|
-
{
|
|
150
|
-
name: "value",
|
|
151
|
-
type: "string",
|
|
152
|
-
required: true,
|
|
153
|
-
description: "The controlled value of the select.",
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
name: "onValueChange",
|
|
157
|
-
type: "(value: string) => void",
|
|
158
|
-
required: true,
|
|
159
|
-
description: "Callback when the selected value changes.",
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
name: "options",
|
|
163
|
-
type: "SelectOption[]",
|
|
164
|
-
required: true,
|
|
165
|
-
description: "Array of options to display.",
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
name: "placeholder",
|
|
169
|
-
type: "string",
|
|
170
|
-
description: "Placeholder text when no value is selected.",
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
name: "className",
|
|
174
|
-
type: "string",
|
|
175
|
-
description: "Additional CSS classes for the trigger.",
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
name: "disabled",
|
|
179
|
-
type: "boolean",
|
|
180
|
-
description: "Whether the select is disabled.",
|
|
181
|
-
},
|
|
182
|
-
]}
|
|
183
|
-
/>
|
|
184
|
-
|
|
185
|
-
### SelectOption
|
|
186
|
-
|
|
187
|
-
<ParametersTable
|
|
188
|
-
type="SelectOption"
|
|
189
|
-
parameters={[
|
|
190
|
-
{
|
|
191
|
-
name: "value",
|
|
192
|
-
type: "string",
|
|
193
|
-
required: true,
|
|
194
|
-
description: "The value of the option.",
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
name: "label",
|
|
198
|
-
type: "ReactNode",
|
|
199
|
-
required: true,
|
|
200
|
-
description: "The display label for the option.",
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
name: "textValue",
|
|
204
|
-
type: "string",
|
|
205
|
-
description: "Optional text value for typeahead. Defaults to label if it's a string.",
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
name: "disabled",
|
|
209
|
-
type: "boolean",
|
|
210
|
-
description: "Whether the option is disabled.",
|
|
211
|
-
},
|
|
212
|
-
]}
|
|
213
|
-
/>
|
|
214
|
-
|
|
215
|
-
### SelectTrigger
|
|
216
|
-
|
|
217
|
-
The button that opens the dropdown.
|
|
218
|
-
|
|
219
|
-
<ParametersTable
|
|
220
|
-
type="SelectTriggerProps"
|
|
221
|
-
parameters={[
|
|
222
|
-
{
|
|
223
|
-
name: "variant",
|
|
224
|
-
type: '"outline" | "ghost" | "muted"',
|
|
225
|
-
default: '"outline"',
|
|
226
|
-
description: "The visual style of the trigger.",
|
|
227
|
-
},
|
|
228
|
-
{
|
|
229
|
-
name: "size",
|
|
230
|
-
type: '"sm" | "default" | "lg"',
|
|
231
|
-
default: '"default"',
|
|
232
|
-
description: "The size of the trigger.",
|
|
233
|
-
},
|
|
234
|
-
{
|
|
235
|
-
name: "className",
|
|
236
|
-
type: "string",
|
|
237
|
-
description: "Additional CSS classes.",
|
|
238
|
-
},
|
|
239
|
-
]}
|
|
240
|
-
/>
|
|
241
|
-
|
|
242
|
-
### Style Variants (CVA)
|
|
243
|
-
|
|
244
|
-
| Export | Description |
|
|
245
|
-
|--------|-------------|
|
|
246
|
-
| `selectTriggerVariants` | Styles for the select trigger button. |
|
|
247
|
-
|
|
248
|
-
```tsx
|
|
249
|
-
import { selectTriggerVariants } from "@/components/assistant-ui/select";
|
|
250
|
-
|
|
251
|
-
<button className={selectTriggerVariants({ variant: "ghost", size: "sm" })}>
|
|
252
|
-
Custom Trigger
|
|
253
|
-
</button>
|
|
254
|
-
```
|
|
@@ -1,271 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Tabs
|
|
3
|
-
description: A multi-variant tabs component for organizing content into switchable panels.
|
|
4
|
-
links:
|
|
5
|
-
- label: Radix UI Tabs (Radix styles)
|
|
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
|
|
9
|
-
platforms: ["react"]
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
import { PreviewCode } from "@/components/docs/preview-code.server";
|
|
13
|
-
import {
|
|
14
|
-
TabsSample,
|
|
15
|
-
TabsVariantsSample,
|
|
16
|
-
TabsSizesSample,
|
|
17
|
-
TabsWithIconsSample,
|
|
18
|
-
TabsControlledSample,
|
|
19
|
-
TabsAsLinkSample,
|
|
20
|
-
TabsAnimatedIndicatorSample,
|
|
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";
|
|
24
|
-
|
|
25
|
-
<Callout>
|
|
26
|
-
This is a **standalone component** that does not depend on the assistant-ui runtime. Use it anywhere in your application.
|
|
27
|
-
</Callout>
|
|
28
|
-
|
|
29
|
-
<FlavorSwitcher />
|
|
30
|
-
|
|
31
|
-
<Flavored radix={<TabsRadixSamples.TabsSample />} base={<TabsSample />} />
|
|
32
|
-
|
|
33
|
-
## Installation
|
|
34
|
-
|
|
35
|
-
<InstallCommand shadcn={["tabs"]} />
|
|
36
|
-
|
|
37
|
-
## Usage
|
|
38
|
-
|
|
39
|
-
```tsx
|
|
40
|
-
import {
|
|
41
|
-
Tabs,
|
|
42
|
-
TabsList,
|
|
43
|
-
TabsTrigger,
|
|
44
|
-
TabsContent,
|
|
45
|
-
} from "@/components/assistant-ui/tabs";
|
|
46
|
-
|
|
47
|
-
export function Example() {
|
|
48
|
-
return (
|
|
49
|
-
<Tabs defaultValue="account">
|
|
50
|
-
<TabsList>
|
|
51
|
-
<TabsTrigger value="account">Account</TabsTrigger>
|
|
52
|
-
<TabsTrigger value="password">Password</TabsTrigger>
|
|
53
|
-
</TabsList>
|
|
54
|
-
<TabsContent value="account">Account settings here.</TabsContent>
|
|
55
|
-
<TabsContent value="password">Password settings here.</TabsContent>
|
|
56
|
-
</Tabs>
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
## Examples
|
|
62
|
-
|
|
63
|
-
### Variants
|
|
64
|
-
|
|
65
|
-
Use the `variant` prop on `TabsList` to change the visual style. Child components inherit the variant automatically.
|
|
66
|
-
|
|
67
|
-
<Flavored radix={<TabsRadixSamples.TabsVariantsSample />} base={<TabsVariantsSample />} />
|
|
68
|
-
|
|
69
|
-
```tsx
|
|
70
|
-
<TabsList variant="default" /> // Muted background with shadow (default)
|
|
71
|
-
<TabsList variant="line" /> // Underline indicator
|
|
72
|
-
<TabsList variant="ghost" /> // Transparent with hover states
|
|
73
|
-
<TabsList variant="pills" /> // Rounded pill buttons
|
|
74
|
-
<TabsList variant="outline" /> // Border with background on active
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
### Sizes
|
|
78
|
-
|
|
79
|
-
Use the `size` prop on `TabsList` to change the tab height. Child components inherit the size automatically.
|
|
80
|
-
|
|
81
|
-
<Flavored radix={<TabsRadixSamples.TabsSizesSample />} base={<TabsSizesSample />} />
|
|
82
|
-
|
|
83
|
-
```tsx
|
|
84
|
-
<TabsList size="sm" /> // 32px height
|
|
85
|
-
<TabsList size="default" /> // 36px height
|
|
86
|
-
<TabsList size="lg" /> // 40px height
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
### With Icons
|
|
90
|
-
|
|
91
|
-
Tabs automatically style SVG icons placed inside triggers.
|
|
92
|
-
|
|
93
|
-
<PreviewCode file="components/docs/samples/tabs" name="TabsWithIconsSample" base={<TabsWithIconsSample />}>
|
|
94
|
-
<TabsRadixSamples.TabsWithIconsSample />
|
|
95
|
-
</PreviewCode>
|
|
96
|
-
|
|
97
|
-
### Controlled
|
|
98
|
-
|
|
99
|
-
Use `value` and `onValueChange` for controlled tab state.
|
|
100
|
-
|
|
101
|
-
<PreviewCode file="components/docs/samples/tabs" name="TabsControlledSample" base={<TabsControlledSample />}>
|
|
102
|
-
<TabsRadixSamples.TabsControlledSample />
|
|
103
|
-
</PreviewCode>
|
|
104
|
-
|
|
105
|
-
### As Link
|
|
106
|
-
|
|
107
|
-
Compose with `render` (Base UI) or `asChild` (Radix) on `TabsTrigger` to render as a different element, like a navigation link.
|
|
108
|
-
|
|
109
|
-
<PreviewCode file="components/docs/samples/tabs" name="TabsAsLinkSample" base={<TabsAsLinkSample />}>
|
|
110
|
-
<TabsRadixSamples.TabsAsLinkSample />
|
|
111
|
-
</PreviewCode>
|
|
112
|
-
|
|
113
|
-
### Animated Indicator
|
|
114
|
-
|
|
115
|
-
All variants feature smooth animated indicators that slide between tabs:
|
|
116
|
-
|
|
117
|
-
| Variant | Indicator Style |
|
|
118
|
-
|---------|-----------------|
|
|
119
|
-
| `default` | Sliding background with shadow |
|
|
120
|
-
| `line` | Sliding underline |
|
|
121
|
-
| `ghost` | Sliding background with hover effect |
|
|
122
|
-
| `pills` | Sliding pill background |
|
|
123
|
-
| `outline` | Sliding border |
|
|
124
|
-
|
|
125
|
-
<PreviewCode file="components/docs/samples/tabs" name="TabsAnimatedIndicatorSample" base={<TabsAnimatedIndicatorSample />}>
|
|
126
|
-
<TabsRadixSamples.TabsAnimatedIndicatorSample />
|
|
127
|
-
</PreviewCode>
|
|
128
|
-
|
|
129
|
-
## API Reference
|
|
130
|
-
|
|
131
|
-
### Composable API
|
|
132
|
-
|
|
133
|
-
| Component | Description |
|
|
134
|
-
|-----------|-------------|
|
|
135
|
-
| `Tabs` | The root component that manages tab state. |
|
|
136
|
-
| `TabsList` | The container for tab triggers. Set `variant` and `size` here. |
|
|
137
|
-
| `TabsTrigger` | An individual tab button. Inherits variant/size from TabsList. |
|
|
138
|
-
| `TabsContent` | The content panel for a tab. |
|
|
139
|
-
|
|
140
|
-
### Tabs
|
|
141
|
-
|
|
142
|
-
The root component that manages tab state.
|
|
143
|
-
|
|
144
|
-
<ParametersTable
|
|
145
|
-
type="TabsProps"
|
|
146
|
-
parameters={[
|
|
147
|
-
{
|
|
148
|
-
name: "defaultValue",
|
|
149
|
-
type: "string",
|
|
150
|
-
description: "The default active tab value (uncontrolled).",
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
name: "value",
|
|
154
|
-
type: "string",
|
|
155
|
-
description: "The controlled active tab value.",
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
name: "onValueChange",
|
|
159
|
-
type: "(value: string) => void",
|
|
160
|
-
description: "Callback when the active tab changes.",
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
name: "className",
|
|
164
|
-
type: "string",
|
|
165
|
-
description: "Additional CSS classes.",
|
|
166
|
-
},
|
|
167
|
-
]}
|
|
168
|
-
/>
|
|
169
|
-
|
|
170
|
-
### TabsList
|
|
171
|
-
|
|
172
|
-
The container for tab triggers. Set `variant` and `size` here to style all child components.
|
|
173
|
-
|
|
174
|
-
<ParametersTable
|
|
175
|
-
type="TabsListProps"
|
|
176
|
-
parameters={[
|
|
177
|
-
{
|
|
178
|
-
name: "variant",
|
|
179
|
-
type: '"default" | "line" | "ghost" | "pills" | "outline"',
|
|
180
|
-
default: '"default"',
|
|
181
|
-
description: "The visual style of the tabs. Child components inherit this automatically.",
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
name: "size",
|
|
185
|
-
type: '"sm" | "default" | "lg"',
|
|
186
|
-
default: '"default"',
|
|
187
|
-
description: "The size of the tabs. Child components inherit this automatically.",
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
name: "className",
|
|
191
|
-
type: "string",
|
|
192
|
-
description: "Additional CSS classes.",
|
|
193
|
-
},
|
|
194
|
-
]}
|
|
195
|
-
/>
|
|
196
|
-
|
|
197
|
-
### TabsTrigger
|
|
198
|
-
|
|
199
|
-
An individual tab button.
|
|
200
|
-
|
|
201
|
-
<ParametersTable
|
|
202
|
-
type="TabsTriggerProps"
|
|
203
|
-
parameters={[
|
|
204
|
-
{
|
|
205
|
-
name: "value",
|
|
206
|
-
type: "string",
|
|
207
|
-
required: true,
|
|
208
|
-
description: "The unique value for this tab.",
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
name: "render",
|
|
212
|
-
type: "ReactElement | function",
|
|
213
|
-
description: "Base UI: compose as a different element instead of rendering a button.",
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
name: "asChild",
|
|
217
|
-
type: "boolean",
|
|
218
|
-
default: "false",
|
|
219
|
-
description: "Radix: merge props with a child element instead of rendering a button.",
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
name: "disabled",
|
|
223
|
-
type: "boolean",
|
|
224
|
-
description: "Whether the tab is disabled.",
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
name: "className",
|
|
228
|
-
type: "string",
|
|
229
|
-
description: "Additional CSS classes.",
|
|
230
|
-
},
|
|
231
|
-
]}
|
|
232
|
-
/>
|
|
233
|
-
|
|
234
|
-
### TabsContent
|
|
235
|
-
|
|
236
|
-
The content panel for a tab.
|
|
237
|
-
|
|
238
|
-
<ParametersTable
|
|
239
|
-
type="TabsContentProps"
|
|
240
|
-
parameters={[
|
|
241
|
-
{
|
|
242
|
-
name: "value",
|
|
243
|
-
type: "string",
|
|
244
|
-
required: true,
|
|
245
|
-
description: "The value matching the corresponding TabsTrigger.",
|
|
246
|
-
},
|
|
247
|
-
{
|
|
248
|
-
name: "className",
|
|
249
|
-
type: "string",
|
|
250
|
-
description: "Additional CSS classes.",
|
|
251
|
-
},
|
|
252
|
-
]}
|
|
253
|
-
/>
|
|
254
|
-
|
|
255
|
-
### Style Variants (CVA)
|
|
256
|
-
|
|
257
|
-
| Export | Description |
|
|
258
|
-
|--------|-------------|
|
|
259
|
-
| `tabsListVariants` | Styles for the tabs list container. |
|
|
260
|
-
| `tabsActiveIndicatorVariants` | Styles for the animated active indicator. |
|
|
261
|
-
|
|
262
|
-
```tsx
|
|
263
|
-
import {
|
|
264
|
-
tabsListVariants,
|
|
265
|
-
tabsActiveIndicatorVariants,
|
|
266
|
-
} from "@/components/assistant-ui/tabs";
|
|
267
|
-
|
|
268
|
-
<div className={tabsListVariants({ variant: "ghost", size: "sm" })}>
|
|
269
|
-
Custom Tabs Container
|
|
270
|
-
</div>
|
|
271
|
-
```
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|