@assistant-ui/mcp-docs-server 0.1.23 → 0.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.docs/organized/code-examples/waterfall.md +5 -3
- package/.docs/organized/code-examples/with-a2a.md +676 -0
- package/.docs/organized/code-examples/with-ag-ui.md +7 -8
- package/.docs/organized/code-examples/with-ai-sdk-v6.md +28 -16
- package/.docs/organized/code-examples/with-artifacts.md +5 -5
- package/.docs/organized/code-examples/with-assistant-transport.md +3 -3
- package/.docs/organized/code-examples/with-chain-of-thought.md +34 -26
- package/.docs/organized/code-examples/with-cloud-standalone.md +10 -8
- package/.docs/organized/code-examples/with-cloud.md +5 -5
- package/.docs/organized/code-examples/with-custom-thread-list.md +7 -7
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +8 -8
- package/.docs/organized/code-examples/with-expo.md +571 -539
- package/.docs/organized/code-examples/with-external-store.md +3 -4
- package/.docs/organized/code-examples/with-ffmpeg.md +5 -5
- package/.docs/organized/code-examples/with-google-adk.md +353 -0
- package/.docs/organized/code-examples/with-heat-graph.md +304 -0
- package/.docs/organized/code-examples/with-langgraph.md +25 -23
- package/.docs/organized/code-examples/with-parent-id-grouping.md +4 -4
- package/.docs/organized/code-examples/with-react-hook-form.md +6 -9
- package/.docs/organized/code-examples/with-react-ink.md +265 -0
- package/.docs/organized/code-examples/with-react-router.md +10 -11
- package/.docs/organized/code-examples/with-store.md +29 -18
- package/.docs/organized/code-examples/with-tanstack.md +7 -7
- package/.docs/organized/code-examples/with-tap-runtime.md +6 -4
- package/.docs/raw/blog/2025-01-31-changelog/index.mdx +1 -1
- package/.docs/raw/blog/2026-03-launch-week/index.mdx +227 -0
- package/.docs/raw/docs/(docs)/architecture.mdx +1 -1
- package/.docs/raw/docs/(docs)/cli.mdx +14 -9
- package/.docs/raw/docs/(docs)/copilots/make-assistant-tool-ui.mdx +8 -3
- package/.docs/raw/docs/(docs)/copilots/make-assistant-tool.mdx +5 -1
- package/.docs/raw/docs/(docs)/copilots/{make-assistant-readable.mdx → make-assistant-visible.mdx} +14 -5
- package/.docs/raw/docs/(docs)/copilots/model-context.mdx +11 -11
- package/.docs/raw/docs/(docs)/copilots/motivation.mdx +2 -2
- package/.docs/raw/docs/(docs)/devtools.mdx +3 -2
- package/.docs/raw/docs/(docs)/guides/attachments.mdx +9 -11
- package/.docs/raw/docs/(docs)/guides/branching.mdx +11 -6
- package/.docs/raw/docs/(docs)/guides/chain-of-thought.mdx +18 -16
- package/.docs/raw/docs/(docs)/guides/context-api.mdx +81 -43
- package/.docs/raw/docs/(docs)/guides/dictation.mdx +5 -5
- package/.docs/raw/docs/(docs)/guides/editing.mdx +16 -7
- package/.docs/raw/docs/(docs)/guides/latex.mdx +3 -0
- package/.docs/raw/docs/(docs)/guides/message-timing.mdx +2 -1
- package/.docs/raw/docs/(docs)/guides/multi-agent.mdx +173 -0
- package/.docs/raw/docs/(docs)/guides/quoting.mdx +55 -206
- package/.docs/raw/docs/(docs)/guides/speech.mdx +1 -4
- package/.docs/raw/docs/(docs)/guides/suggestions.mdx +9 -15
- package/.docs/raw/docs/(docs)/guides/tool-ui.mdx +17 -7
- package/.docs/raw/docs/(docs)/guides/tools.mdx +24 -9
- package/.docs/raw/docs/(docs)/index.mdx +3 -3
- package/.docs/raw/docs/(docs)/installation.mdx +69 -46
- package/.docs/raw/docs/(reference)/api-reference/context-providers/text-message-part-provider.mdx +20 -6
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-data-stream.mdx +24 -4
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-hook-form.mdx +1 -1
- package/.docs/raw/docs/(reference)/api-reference/integrations/vercel-ai-sdk.mdx +20 -19
- package/.docs/raw/docs/(reference)/api-reference/overview.mdx +28 -53
- package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar.mdx +4 -4
- package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-modal.mdx +7 -1
- package/.docs/raw/docs/(reference)/api-reference/primitives/attachment.mdx +20 -14
- package/.docs/raw/docs/(reference)/api-reference/primitives/branch-picker.mdx +1 -1
- package/.docs/raw/docs/(reference)/api-reference/primitives/composer.mdx +99 -45
- package/.docs/raw/docs/(reference)/api-reference/primitives/message-part.mdx +52 -40
- package/.docs/raw/docs/(reference)/api-reference/primitives/message.mdx +343 -23
- package/.docs/raw/docs/(reference)/api-reference/primitives/suggestion.mdx +4 -6
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list-item.mdx +4 -2
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list.mdx +3 -5
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread.mdx +169 -22
- package/.docs/raw/docs/(reference)/api-reference/runtimes/assistant-runtime.mdx +14 -4
- package/.docs/raw/docs/(reference)/api-reference/runtimes/attachment-runtime.mdx +15 -26
- package/.docs/raw/docs/(reference)/api-reference/runtimes/composer-runtime.mdx +39 -21
- package/.docs/raw/docs/(reference)/api-reference/runtimes/message-part-runtime.mdx +33 -9
- package/.docs/raw/docs/(reference)/api-reference/runtimes/message-runtime.mdx +48 -21
- package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-list-item-runtime.mdx +36 -7
- package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-list-runtime.mdx +30 -10
- package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-runtime.mdx +12 -10
- package/.docs/raw/docs/(reference)/migrations/deprecation-policy.mdx +1 -1
- package/.docs/raw/docs/(reference)/migrations/react-langgraph-v0-7.mdx +9 -4
- package/.docs/raw/docs/(reference)/migrations/v0-11.mdx +7 -5
- package/.docs/raw/docs/(reference)/migrations/v0-12.mdx +9 -7
- package/.docs/raw/docs/(reference)/migrations/v0-14.mdx +159 -0
- package/.docs/raw/docs/(reference)/react-compatibility.mdx +5 -134
- package/.docs/raw/docs/cloud/ai-sdk-assistant-ui.mdx +89 -7
- package/.docs/raw/docs/cloud/ai-sdk.mdx +19 -5
- package/.docs/raw/docs/cloud/langgraph.mdx +13 -3
- package/.docs/raw/docs/ink/adapters.mdx +41 -0
- package/.docs/raw/docs/ink/custom-backend.mdx +203 -0
- package/.docs/raw/docs/ink/hooks.mdx +448 -0
- package/.docs/raw/docs/ink/index.mdx +239 -0
- package/.docs/raw/docs/ink/migration.mdx +140 -0
- package/.docs/raw/docs/ink/primitives.mdx +699 -0
- package/.docs/raw/docs/react-native/adapters.mdx +63 -87
- package/.docs/raw/docs/react-native/custom-backend.mdx +11 -14
- package/.docs/raw/docs/react-native/hooks.mdx +214 -232
- package/.docs/raw/docs/react-native/index.mdx +118 -159
- package/.docs/raw/docs/react-native/migration.mdx +144 -0
- package/.docs/raw/docs/react-native/primitives.mdx +431 -302
- package/.docs/raw/docs/runtimes/a2a/index.mdx +294 -0
- package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +9 -9
- package/.docs/raw/docs/runtimes/ai-sdk/v5-legacy.mdx +14 -3
- package/.docs/raw/docs/runtimes/ai-sdk/v6.mdx +53 -0
- package/.docs/raw/docs/runtimes/assistant-transport.mdx +59 -25
- package/.docs/raw/docs/runtimes/custom/custom-thread-list.mdx +13 -6
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +138 -38
- package/.docs/raw/docs/runtimes/custom/local.mdx +184 -42
- package/.docs/raw/docs/runtimes/data-stream.mdx +92 -19
- package/.docs/raw/docs/runtimes/google-adk/index.mdx +624 -0
- package/.docs/raw/docs/runtimes/helicone.mdx +6 -6
- package/.docs/raw/docs/runtimes/langgraph/index.mdx +38 -27
- package/.docs/raw/docs/runtimes/langgraph/tutorial/introduction.mdx +1 -1
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-1.mdx +15 -20
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-2.mdx +7 -11
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-3.mdx +8 -11
- package/.docs/raw/docs/runtimes/langserve.mdx +6 -7
- package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +18 -3
- package/.docs/raw/docs/ui/context-display.mdx +147 -0
- package/.docs/raw/docs/ui/file.mdx +5 -4
- package/.docs/raw/docs/ui/image.mdx +5 -4
- package/.docs/raw/docs/ui/markdown.mdx +3 -1
- package/.docs/raw/docs/ui/model-selector.mdx +8 -8
- package/.docs/raw/docs/ui/part-grouping.mdx +7 -10
- package/.docs/raw/docs/ui/quote.mdx +210 -0
- package/.docs/raw/docs/ui/reasoning.mdx +12 -11
- package/.docs/raw/docs/ui/sources.mdx +88 -17
- package/.docs/raw/docs/ui/streamdown.mdx +16 -7
- package/.docs/raw/docs/ui/thread-list.mdx +11 -13
- package/.docs/raw/docs/ui/thread.mdx +28 -33
- package/.docs/raw/docs/ui/tool-fallback.mdx +5 -6
- package/.docs/raw/docs/ui/tool-group.mdx +9 -8
- package/.docs/raw/docs/utilities/heat-graph.mdx +236 -0
- package/.docs/raw/docs/utilities/tw-shimmer.mdx +211 -0
- package/package.json +4 -4
- package/.docs/raw/docs/(reference)/legacy/styled/assistant-modal.mdx +0 -77
- package/.docs/raw/docs/(reference)/legacy/styled/decomposition.mdx +0 -635
- package/.docs/raw/docs/(reference)/legacy/styled/markdown.mdx +0 -77
- package/.docs/raw/docs/(reference)/legacy/styled/scrollbar.mdx +0 -72
- package/.docs/raw/docs/(reference)/legacy/styled/thread-width.mdx +0 -22
- package/.docs/raw/docs/(reference)/legacy/styled/thread.mdx +0 -77
- /package/.docs/raw/docs/cloud/{overview.mdx → index.mdx} +0 -0
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: heat-graph
|
|
3
|
+
description: Headless, composable activity heatmap components for React.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import { HeatGraphDemo } from "@/app/heat-graph/heat-graph-demo";
|
|
7
|
+
|
|
8
|
+
`heat-graph` provides headless, Radix-style primitives for building GitHub-style activity heatmap graphs.
|
|
9
|
+
|
|
10
|
+
- **Composable** — Radix-style compound components you fully control
|
|
11
|
+
- **Headless** — Zero styling opinions, bring your own CSS/Tailwind
|
|
12
|
+
- **Tooltip built-in** — Powered by Radix Popper for positioning
|
|
13
|
+
- **Customizable bucketing** — Plug in your own classification function
|
|
14
|
+
|
|
15
|
+
<HeatGraphDemo />
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
<Tabs items={["shadcn", "npm", "pnpm", "yarn"]}>
|
|
20
|
+
<Tab value="shadcn">
|
|
21
|
+
```sh
|
|
22
|
+
npx shadcn@latest add https://r.assistant-ui.com/heat-graph
|
|
23
|
+
```
|
|
24
|
+
This installs a pre-styled `HeatGraph` component to `components/assistant-ui/heat-graph.tsx` along with the `heat-graph` package.
|
|
25
|
+
</Tab>
|
|
26
|
+
<Tab value="npm">
|
|
27
|
+
```sh
|
|
28
|
+
npm install heat-graph
|
|
29
|
+
```
|
|
30
|
+
</Tab>
|
|
31
|
+
<Tab value="pnpm">
|
|
32
|
+
```sh
|
|
33
|
+
pnpm add heat-graph
|
|
34
|
+
```
|
|
35
|
+
</Tab>
|
|
36
|
+
<Tab value="yarn">
|
|
37
|
+
```sh
|
|
38
|
+
yarn add heat-graph
|
|
39
|
+
```
|
|
40
|
+
</Tab>
|
|
41
|
+
</Tabs>
|
|
42
|
+
|
|
43
|
+
## Quick Start
|
|
44
|
+
|
|
45
|
+
```tsx title="components/activity-graph.tsx"
|
|
46
|
+
"use client";
|
|
47
|
+
|
|
48
|
+
import * as HeatGraph from "heat-graph";
|
|
49
|
+
|
|
50
|
+
const COLORS = ["#ebedf0", "#c6d7f9", "#8fb0f3", "#5888e8", "#2563eb"];
|
|
51
|
+
|
|
52
|
+
export function ActivityGraph({ data }: { data: HeatGraph.DataPoint[] }) {
|
|
53
|
+
return (
|
|
54
|
+
<HeatGraph.Root data={data} weekStart="monday" colorScale={COLORS}>
|
|
55
|
+
<HeatGraph.Grid className="gap-[3px]">
|
|
56
|
+
{() => (
|
|
57
|
+
<HeatGraph.Cell className="aspect-square rounded-sm" />
|
|
58
|
+
)}
|
|
59
|
+
</HeatGraph.Grid>
|
|
60
|
+
<HeatGraph.Tooltip>
|
|
61
|
+
{({ cell }) => (
|
|
62
|
+
<div>
|
|
63
|
+
{cell.count} contributions on {cell.date.toLocaleDateString()}
|
|
64
|
+
</div>
|
|
65
|
+
)}
|
|
66
|
+
</HeatGraph.Tooltip>
|
|
67
|
+
</HeatGraph.Root>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
<Callout type="info">
|
|
73
|
+
Components using Heat Graph must be Client Components (`"use client"`), since they rely on React Context and interactivity.
|
|
74
|
+
</Callout>
|
|
75
|
+
|
|
76
|
+
## Anatomy
|
|
77
|
+
|
|
78
|
+
```tsx
|
|
79
|
+
import * as HeatGraph from "heat-graph";
|
|
80
|
+
|
|
81
|
+
<HeatGraph.Root data={data} colorScale={colors}>
|
|
82
|
+
|
|
83
|
+
{/* Month labels — iterates internally, renders each label */}
|
|
84
|
+
<HeatGraph.MonthLabels>
|
|
85
|
+
{({ label, totalWeeks }) => (
|
|
86
|
+
<span style={{ left: `${(label.column / totalWeeks) * 100}%` }}>
|
|
87
|
+
{HeatGraph.MONTH_SHORT[label.month]}
|
|
88
|
+
</span>
|
|
89
|
+
)}
|
|
90
|
+
</HeatGraph.MonthLabels>
|
|
91
|
+
|
|
92
|
+
{/* Day-of-week labels — iterates internally, renders each label */}
|
|
93
|
+
<HeatGraph.DayLabels>
|
|
94
|
+
{({ label }) => (
|
|
95
|
+
<span>{HeatGraph.DAY_SHORT[label.dayOfWeek]}</span>
|
|
96
|
+
)}
|
|
97
|
+
</HeatGraph.DayLabels>
|
|
98
|
+
|
|
99
|
+
{/* Grid + Cells — iterates internally, renders each cell */}
|
|
100
|
+
<HeatGraph.Grid>
|
|
101
|
+
{() => <HeatGraph.Cell />}
|
|
102
|
+
</HeatGraph.Grid>
|
|
103
|
+
|
|
104
|
+
{/* Legend — iterates internally, renders each level */}
|
|
105
|
+
<HeatGraph.Legend>
|
|
106
|
+
{() => <HeatGraph.LegendLevel />}
|
|
107
|
+
</HeatGraph.Legend>
|
|
108
|
+
|
|
109
|
+
{/* Tooltip */}
|
|
110
|
+
<HeatGraph.Tooltip>
|
|
111
|
+
{({ cell }) => <div>{cell.count} on {cell.date.toLocaleDateString()}</div>}
|
|
112
|
+
</HeatGraph.Tooltip>
|
|
113
|
+
|
|
114
|
+
</HeatGraph.Root>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## API Reference
|
|
118
|
+
|
|
119
|
+
### Root
|
|
120
|
+
|
|
121
|
+
The top-level provider. Renders a `<div>` that computes the grid layout and provides state to all children. Accepts all standard div props.
|
|
122
|
+
|
|
123
|
+
| Prop | Type | Default | Description |
|
|
124
|
+
| ------------ | ---------------------- | ------------------- | -------------------------------------------------- |
|
|
125
|
+
| `data` | `DataPoint[]` | required | Array of `{ date: string \| Date, count: number }` |
|
|
126
|
+
| `start` | `string \| Date` | 1 year before `end` | Start of the date range |
|
|
127
|
+
| `end` | `string \| Date` | today | End of the date range |
|
|
128
|
+
| `weekStart` | `"sunday" \| "monday"` | `"sunday"` | First day of the week |
|
|
129
|
+
| `classify` | `ClassifyFn` | `autoLevels(5)` | Bucketing function mapping counts to levels |
|
|
130
|
+
| `colorScale` | `string[]` | — | Array of colors, one per level (index 0 = lowest) |
|
|
131
|
+
|
|
132
|
+
### Grid
|
|
133
|
+
|
|
134
|
+
A `<div>` with CSS Grid layout. Renders `gridTemplateColumns` and `gridTemplateRows` based on the computed data. Accepts all standard div props.
|
|
135
|
+
|
|
136
|
+
Iterates over cells internally, calling the children render function for each cell. Each cell is wrapped in a context that `Cell` reads from.
|
|
137
|
+
|
|
138
|
+
```ts
|
|
139
|
+
type CellData = {
|
|
140
|
+
date: Date;
|
|
141
|
+
count: number;
|
|
142
|
+
level: number;
|
|
143
|
+
column: number;
|
|
144
|
+
row: number;
|
|
145
|
+
};
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Cell
|
|
149
|
+
|
|
150
|
+
A `<div>` that reads from cell context. Automatically applies:
|
|
151
|
+
- Grid positioning (`gridColumn`, `gridRow`)
|
|
152
|
+
- Background color from `colorScale`
|
|
153
|
+
- Tooltip hover handlers
|
|
154
|
+
|
|
155
|
+
Accepts all standard div props. Pass `colorScale` to override the Root-level color scale.
|
|
156
|
+
|
|
157
|
+
### MonthLabels
|
|
158
|
+
|
|
159
|
+
Iterates over month labels, calling the children render function for each label.
|
|
160
|
+
|
|
161
|
+
```tsx
|
|
162
|
+
<HeatGraph.MonthLabels>
|
|
163
|
+
{({ label, totalWeeks }) => (
|
|
164
|
+
<span style={{ left: `${(label.column / totalWeeks) * 100}%` }}>
|
|
165
|
+
{HeatGraph.MONTH_SHORT[label.month]}
|
|
166
|
+
</span>
|
|
167
|
+
)}
|
|
168
|
+
</HeatGraph.MonthLabels>
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Each label has `{ month: number, column: number }`. Use `totalWeeks` to compute label positions. Use `MONTH_SHORT[label.month]` for English labels, or format with `Intl.DateTimeFormat` for localization.
|
|
172
|
+
|
|
173
|
+
### DayLabels
|
|
174
|
+
|
|
175
|
+
Iterates over day-of-week labels, calling the children render function for each label.
|
|
176
|
+
|
|
177
|
+
```tsx
|
|
178
|
+
<HeatGraph.DayLabels>
|
|
179
|
+
{({ label }) => (
|
|
180
|
+
<span>{HeatGraph.DAY_SHORT[label.dayOfWeek]}</span>
|
|
181
|
+
)}
|
|
182
|
+
</HeatGraph.DayLabels>
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Each label has `{ dayOfWeek: number, row: number }` where `dayOfWeek` is 0=Sun..6=Sat. Use `DAY_SHORT[label.dayOfWeek]` for English labels, or format with `Intl.DateTimeFormat` for localization.
|
|
186
|
+
|
|
187
|
+
### Legend
|
|
188
|
+
|
|
189
|
+
Iterates over legend levels, calling the children render function for each item. Each item has `{ level: number, color: string | undefined }`.
|
|
190
|
+
|
|
191
|
+
### LegendLevel
|
|
192
|
+
|
|
193
|
+
A `<div>` that reads from legend item context. Automatically applies `backgroundColor` from the color scale. Use inside `Legend`.
|
|
194
|
+
|
|
195
|
+
### Tooltip
|
|
196
|
+
|
|
197
|
+
Renders only when a cell is hovered. Positioned by Radix Popper relative to the hovered cell. Accepts Radix Popper `Content` props (`side`, `sideOffset`, `align`, etc.).
|
|
198
|
+
|
|
199
|
+
```tsx
|
|
200
|
+
<HeatGraph.Tooltip side="top" sideOffset={8} className="...">
|
|
201
|
+
{({ cell }) => <div>{cell.count} contributions</div>}
|
|
202
|
+
</HeatGraph.Tooltip>
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### autoLevels(n)
|
|
206
|
+
|
|
207
|
+
Default classification function. Maps counts into `n` evenly-distributed levels (0 to n-1). Level 0 is always count 0.
|
|
208
|
+
|
|
209
|
+
```ts
|
|
210
|
+
type ClassifyFn = (counts: number[]) => (count: number) => number;
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
To provide a custom classifier:
|
|
214
|
+
|
|
215
|
+
```tsx
|
|
216
|
+
const myClassify: HeatGraph.ClassifyFn = (counts) => {
|
|
217
|
+
const p75 = percentile(counts, 75);
|
|
218
|
+
return (count) => {
|
|
219
|
+
if (count === 0) return 0;
|
|
220
|
+
if (count < p75 * 0.25) return 1;
|
|
221
|
+
if (count < p75 * 0.5) return 2;
|
|
222
|
+
if (count < p75) return 3;
|
|
223
|
+
return 4;
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
<HeatGraph.Root data={data} classify={myClassify}>
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### MONTH_SHORT
|
|
231
|
+
|
|
232
|
+
English month abbreviations array: `["Jan", "Feb", ..., "Dec"]`. Index by `MonthLabel.month`.
|
|
233
|
+
|
|
234
|
+
### DAY_SHORT
|
|
235
|
+
|
|
236
|
+
English day abbreviations array: `["Sun", "Mon", ..., "Sat"]`. Index by `DayLabel.dayOfWeek`.
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: tw-shimmer
|
|
3
|
+
description: Tailwind CSS v4 plugin for shimmer effects.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
`tw-shimmer` is a zero-dependency Tailwind CSS v4 plugin that provides polished shimmer animations for both text and skeleton loaders. It uses sine-eased gradients with 17 carefully calculated stops and OKLCH color mixing for smooth, banding-free effects.
|
|
7
|
+
|
|
8
|
+
- **CSS-only** — No JavaScript runtime, pure Tailwind utilities
|
|
9
|
+
- **Text + Background** — Shimmer text or skeleton placeholders
|
|
10
|
+
- **Auto-sizing** — CSS container queries for automatic width detection
|
|
11
|
+
- **Customizable** — Speed, spread, angle, color, and timing
|
|
12
|
+
|
|
13
|
+
See the [interactive demo](/tw-shimmer) for live examples.
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
<Tabs items={["npm", "pnpm", "yarn"]}>
|
|
18
|
+
<Tab value="npm">
|
|
19
|
+
```sh
|
|
20
|
+
npm install tw-shimmer
|
|
21
|
+
```
|
|
22
|
+
</Tab>
|
|
23
|
+
<Tab value="pnpm">
|
|
24
|
+
```sh
|
|
25
|
+
pnpm add tw-shimmer
|
|
26
|
+
```
|
|
27
|
+
</Tab>
|
|
28
|
+
<Tab value="yarn">
|
|
29
|
+
```sh
|
|
30
|
+
yarn add tw-shimmer
|
|
31
|
+
```
|
|
32
|
+
</Tab>
|
|
33
|
+
</Tabs>
|
|
34
|
+
|
|
35
|
+
Add to your CSS:
|
|
36
|
+
|
|
37
|
+
```css title="app/globals.css"
|
|
38
|
+
@import "tailwindcss";
|
|
39
|
+
@import "tw-shimmer";
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Quick Start
|
|
43
|
+
|
|
44
|
+
### Text Shimmer
|
|
45
|
+
|
|
46
|
+
```html
|
|
47
|
+
<span class="shimmer text-foreground/60">Loading...</span>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
<Callout type="info">
|
|
51
|
+
Set a semi-transparent text color (e.g., `text-foreground/40`) for the shimmer highlight to be visible.
|
|
52
|
+
</Callout>
|
|
53
|
+
|
|
54
|
+
### Skeleton Loader
|
|
55
|
+
|
|
56
|
+
```html
|
|
57
|
+
<div class="shimmer shimmer-bg bg-muted h-4 w-48 rounded" />
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Skeleton Card with Auto-Sizing
|
|
61
|
+
|
|
62
|
+
```html
|
|
63
|
+
<div class="shimmer-container flex gap-3">
|
|
64
|
+
<div class="shimmer-bg bg-muted size-12 rounded-full" />
|
|
65
|
+
<div class="flex-1 space-y-2">
|
|
66
|
+
<div class="shimmer-bg bg-muted h-4 w-1/4 rounded" />
|
|
67
|
+
<div class="shimmer-bg bg-muted h-4 w-full rounded" />
|
|
68
|
+
<div class="shimmer-bg bg-muted h-4 w-4/5 rounded" />
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## API Reference
|
|
74
|
+
|
|
75
|
+
### Core Utilities
|
|
76
|
+
|
|
77
|
+
#### `shimmer`
|
|
78
|
+
|
|
79
|
+
Base utility for text shimmer. Applies a gradient animation over the text foreground color.
|
|
80
|
+
|
|
81
|
+
#### `shimmer-bg`
|
|
82
|
+
|
|
83
|
+
Background shimmer for skeleton loaders. Applies a gradient animation over the element's background. Requires a base `bg-*` class.
|
|
84
|
+
|
|
85
|
+
```html
|
|
86
|
+
<div class="shimmer shimmer-bg bg-muted h-4 w-64 rounded" />
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
#### `shimmer-container`
|
|
90
|
+
|
|
91
|
+
CSS-only auto-sizing helper using container queries. Sets `container-type: inline-size` and automatically derives speed and spread from the container width.
|
|
92
|
+
|
|
93
|
+
```html
|
|
94
|
+
<div class="shimmer-container">
|
|
95
|
+
<div class="shimmer-bg bg-muted h-4 w-full rounded" />
|
|
96
|
+
</div>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
<Callout type="warn">
|
|
100
|
+
`shimmer-container` sets `container-type: inline-size`, which prevents shrink-to-fit sizing. Not recommended for text-only containers.
|
|
101
|
+
</Callout>
|
|
102
|
+
|
|
103
|
+
### Customization Utilities
|
|
104
|
+
|
|
105
|
+
| Utility | Default (text) | Default (bg) | Description |
|
|
106
|
+
| --------------------------- | -------------- | ------------ | ---------------------------------- |
|
|
107
|
+
| `shimmer-speed-{n}` | `150` | `1000` | Animation speed in px/s |
|
|
108
|
+
| `shimmer-width-{n}` | `200` | `800` | Container width in px for timing |
|
|
109
|
+
| `shimmer-spread-{n}` | `6ch` | — | Text shimmer highlight width |
|
|
110
|
+
| `shimmer-bg-spread-{n}` | — | `480px` | Background shimmer highlight width |
|
|
111
|
+
| `shimmer-color-{color}` | auto | auto | Highlight color (Tailwind palette) |
|
|
112
|
+
| `shimmer-angle-{deg}` | `90` | `90` | Sweep direction in degrees |
|
|
113
|
+
| `shimmer-duration-{ms}` | auto | auto | Fixed animation duration |
|
|
114
|
+
| `shimmer-repeat-delay-{ms}` | `1000` | `1000` | Pause between cycles |
|
|
115
|
+
| `shimmer-invert` | — | — | Invert highlight direction |
|
|
116
|
+
|
|
117
|
+
All utilities are **inheritable** — set on a parent to affect all shimmer children.
|
|
118
|
+
|
|
119
|
+
### Speed and Width
|
|
120
|
+
|
|
121
|
+
Speed controls how fast the shimmer moves in pixels per second. Width tells the animation how wide the container is for timing calculations.
|
|
122
|
+
|
|
123
|
+
```html
|
|
124
|
+
<span class="shimmer shimmer-speed-200 shimmer-width-400 text-foreground/40">
|
|
125
|
+
Fast, wide shimmer
|
|
126
|
+
</span>
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Color
|
|
130
|
+
|
|
131
|
+
Use any Tailwind color with optional opacity:
|
|
132
|
+
|
|
133
|
+
```html
|
|
134
|
+
<span class="shimmer shimmer-color-blue-500 text-blue-500/40">
|
|
135
|
+
Blue shimmer
|
|
136
|
+
</span>
|
|
137
|
+
|
|
138
|
+
<div class="shimmer shimmer-bg shimmer-color-blue-300/30 bg-muted h-4 rounded" />
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Angle
|
|
142
|
+
|
|
143
|
+
Control the sweep direction. Default is `90deg` (vertical sweep).
|
|
144
|
+
|
|
145
|
+
```html
|
|
146
|
+
<div class="shimmer-container shimmer-angle-15">
|
|
147
|
+
<div class="shimmer-bg bg-muted h-4 w-full rounded" />
|
|
148
|
+
</div>
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
<Callout type="warn">
|
|
152
|
+
Avoid exactly `0deg` and `180deg` — they cause extreme animation delays. Safe range: 15-75° or 105-165°.
|
|
153
|
+
</Callout>
|
|
154
|
+
|
|
155
|
+
### Position Hints (Angled Shimmer)
|
|
156
|
+
|
|
157
|
+
For angled shimmers, use `shimmer-x-{n}` and `shimmer-y-{n}` to sync elements:
|
|
158
|
+
|
|
159
|
+
```html
|
|
160
|
+
<div class="shimmer-container shimmer-angle-15 flex gap-3">
|
|
161
|
+
<div class="shimmer-bg shimmer-x-20 shimmer-y-20 bg-muted size-12 rounded-full" />
|
|
162
|
+
<div class="flex-1 space-y-2">
|
|
163
|
+
<div class="shimmer-bg shimmer-x-52 shimmer-y-0 bg-muted h-4 w-24 rounded" />
|
|
164
|
+
<div class="shimmer-bg shimmer-x-52 shimmer-y-24 bg-muted h-4 w-full rounded" />
|
|
165
|
+
</div>
|
|
166
|
+
</div>
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Repeat Delay
|
|
170
|
+
|
|
171
|
+
Control the pause between animation cycles:
|
|
172
|
+
|
|
173
|
+
```html
|
|
174
|
+
<!-- Continuous shimmer, no pause -->
|
|
175
|
+
<span class="shimmer shimmer-repeat-delay-0 text-foreground/40">
|
|
176
|
+
Always moving
|
|
177
|
+
</span>
|
|
178
|
+
|
|
179
|
+
<!-- Long pause between cycles -->
|
|
180
|
+
<span class="shimmer shimmer-repeat-delay-3000 text-foreground/40">
|
|
181
|
+
Slow pulse
|
|
182
|
+
</span>
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## CSS Variables
|
|
186
|
+
|
|
187
|
+
All values can be set via CSS variables for dynamic control:
|
|
188
|
+
|
|
189
|
+
| Variable | Description |
|
|
190
|
+
| ------------------------ | ------------------------- |
|
|
191
|
+
| `--shimmer-speed` | Speed in px/s |
|
|
192
|
+
| `--shimmer-width` | Track width in px |
|
|
193
|
+
| `--shimmer-spread` | Highlight width |
|
|
194
|
+
| `--shimmer-angle` | Sweep angle |
|
|
195
|
+
| `--shimmer-color` | Highlight color |
|
|
196
|
+
| `--shimmer-duration` | Override duration (ms) |
|
|
197
|
+
| `--shimmer-repeat-delay` | Pause between cycles (ms) |
|
|
198
|
+
|
|
199
|
+
```tsx
|
|
200
|
+
<div style={{ "--shimmer-width": containerWidth } as React.CSSProperties}>
|
|
201
|
+
<div className="shimmer shimmer-bg bg-muted h-4 w-full rounded" />
|
|
202
|
+
</div>
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## Browser Support
|
|
206
|
+
|
|
207
|
+
Uses modern CSS features: `oklch()`, `color-mix()`, independent `translate` transform, and CSS Container Queries.
|
|
208
|
+
|
|
209
|
+
**Supported:** Chrome 111+, Firefox 113+, Safari 16.4+
|
|
210
|
+
|
|
211
|
+
Older browsers degrade gracefully — shimmer effects simply won't appear.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@assistant-ui/mcp-docs-server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.25",
|
|
4
4
|
"description": "MCP server for assistant-ui documentation and examples",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"zod": "^4.3.6"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@types/node": "^25.
|
|
41
|
+
"@types/node": "^25.5.0",
|
|
42
42
|
"tsx": "^4.21.0",
|
|
43
|
-
"vitest": "^4.0
|
|
44
|
-
"@assistant-ui/x-buildutils": "0.0.
|
|
43
|
+
"vitest": "^4.1.0",
|
|
44
|
+
"@assistant-ui/x-buildutils": "0.0.3"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public",
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: AssistantModal
|
|
3
|
-
description: Chat bubble component for support or Q&A use cases.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## Overview
|
|
8
|
-
|
|
9
|
-
A chat bubble shown in the bottom right corner of the screen. Useful for support or Q&A use cases.
|
|
10
|
-
|
|
11
|
-
## Getting Started
|
|
12
|
-
|
|
13
|
-
<Steps>
|
|
14
|
-
<Step>
|
|
15
|
-
|
|
16
|
-
### Install `@assistant-ui/react-ui`
|
|
17
|
-
|
|
18
|
-
<InstallCommand npm={["@assistant-ui/react-ui"]} />
|
|
19
|
-
|
|
20
|
-
</Step>
|
|
21
|
-
<Step>
|
|
22
|
-
|
|
23
|
-
### Import CSS styles
|
|
24
|
-
|
|
25
|
-
Add the following to your `tailwind.config.ts`:
|
|
26
|
-
|
|
27
|
-
<Tabs items={["Tailwind", "Tailwind + shadcn-ui"]}>
|
|
28
|
-
|
|
29
|
-
```ts title="/tailwind.config.ts" tab="Tailwind"
|
|
30
|
-
{
|
|
31
|
-
plugins: [
|
|
32
|
-
require("tailwindcss-animate"), // make sure to "npm install tailwindcss-animate"
|
|
33
|
-
require("@assistant-ui/react-ui/tailwindcss")({
|
|
34
|
-
components: ["assistant-modal"],
|
|
35
|
-
})
|
|
36
|
-
],
|
|
37
|
-
}
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
```ts title="/tailwind.config.ts" tab="Tailwind + shadcn-ui"
|
|
41
|
-
{
|
|
42
|
-
plugins: [
|
|
43
|
-
require("tailwindcss-animate"), // make sure to "npm install tailwindcss-animate"
|
|
44
|
-
require("@assistant-ui/react-ui/tailwindcss")({
|
|
45
|
-
components: ["assistant-modal"],
|
|
46
|
-
shadcn: true
|
|
47
|
-
})
|
|
48
|
-
],
|
|
49
|
-
}
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
</Tabs>
|
|
53
|
-
|
|
54
|
-
</Step>
|
|
55
|
-
<Step>
|
|
56
|
-
|
|
57
|
-
### Use it in your app
|
|
58
|
-
|
|
59
|
-
```tsx title="/app/page.tsx"
|
|
60
|
-
import { useChatRuntime } from "@assistant-ui/react-ai-sdk";
|
|
61
|
-
import { AssistantModal } from "@assistant-ui/react-ui";
|
|
62
|
-
|
|
63
|
-
const MyApp = () => {
|
|
64
|
-
const runtime = useChatRuntime({
|
|
65
|
-
api: "/api/chat",
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
return (
|
|
69
|
-
<div>
|
|
70
|
-
<AssistantModal runtime={runtime} />
|
|
71
|
-
</div>
|
|
72
|
-
);
|
|
73
|
-
};
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
</Step>
|
|
77
|
-
</Steps>
|