Loading...
Loading...
Installs and customizes assistant-ui elements, the styled shadcn-style component catalog at assistant-ui.com/elements served from the r.assistant-ui.com registry through `npx assistant-ui@latest add <item>`. Use when adding a prebuilt chat surface or widget (Thread, ThreadList, AssistantModal, AssistantSidebar, ToolFallback, ToolGroup, MarkdownText, Reasoning, Sources, Attachment, ModelSelector, Voice orb, McpConfig) or one of the 120 standalone elements (approval card, agent plan, code diff, data table, chart, trace waterfall, message queue, composer variants, and so on), choosing between runtime-connected `<name>.aui.tsx` files and props-driven standalone files, overriding Thread slots through the `components` prop, editing the copied source under `components/assistant-ui/elements/`, using the shared `surfaces.tsx` tokens, or picking the Radix versus Base UI flavor through the style-aware registry URL in `components.json`. Route here when an import from `@/components/assistant-ui/...` fails, an element renders unstyled, or the CLI installs the wrong flavor. For unstyled building blocks use primitives; for the CLI scaffold itself use setup.
npx skill4agent add assistant-ui/skills elementscomponents/assistant-ui/elements/| Kind | File | Needs a runtime | Registry item |
|---|---|---|---|
| Runtime-connected | | Yes, reads the nearest | short name: |
| Standalone | | No, everything comes in through props | |
| Renderer | | Used from a | |
thread-listelements-thread-listreasoningsourcestool-groupmodel-selectormessage-timingcontext-displayvoiceattachmentelements-message-attachmentquoteelements-quote-replyfollow-up-suggestionselements-suggestions.auinpx assistant-ui@latest init # once per project: components.json, style, base elements
npx assistant-ui@latest add thread thread-list
npx assistant-ui@latest add elements-agent-plan elements-code-diffaddnpx shadcn@latest addthreadmarkdown-texttool-fallbacktool-groupreasoningsourcesattachmentimagefilefollow-up-suggestionstooltip-icon-button@assistant-ui/reactlucide-reacttw-shimmerelements-surfacescomponents.json{
"registries": {
"@assistant-ui": "https://r.assistant-ui.com/styles/{style}/{name}.json"
}
}npx shadcn@latest add @assistant-ui/threadbase-*@assistant-ui/reacttooltip-icon-buttonattachmentcontext-displaymessage-timingmcp-configthreadlist-sidebarassistant-modalmodel-selectorselecttabsaccordionbadgedirectionhttps://r.assistant-ui.com/{name}.json"use client";
import { AssistantRuntimeProvider } from "@assistant-ui/react";
import { useChatRuntime } from "@assistant-ui/ai-sdk";
import { Thread } from "@/components/assistant-ui/elements/thread.aui";
import { ThreadList } from "@/components/assistant-ui/elements/thread-list.aui";
export default function Chat() {
const runtime = useChatRuntime();
return (
<AssistantRuntimeProvider runtime={runtime}>
<div className="flex h-dvh">
<ThreadList />
<Thread />
</div>
</AssistantRuntimeProvider>
);
}Threadimport { Thread, type ThreadComponents } from "@/components/assistant-ui/elements/thread.aui";
const THREAD_COMPONENTS: ThreadComponents = {
Welcome: () => <h1 className="text-2xl">Ask me anything</h1>,
ToolFallback: MyToolFallback,
};
export function Chat() {
return <Thread components={THREAD_COMPONENTS} autoFocus={false} />;
}AssistantMessageWelcomeToolFallbackToolGroupReasoningGrouprenderToolFallbackThread--thread-max-width--composer-bg--composer-radius--composer-paddingThreadPrimitive.Rootthread.aui.tsximport { AgentPlan } from "@/components/assistant-ui/elements/agent-plan";
<AgentPlan
steps={["Read the schema", "Write the migration", "Run the tests"]}
activeIndex={1}
/>;steps: readonly string[]activeIndex: numberdivrenderelements-surfacescomponents/assistant-ui/elements/surfaces.tsxpaperfloatingfieldfieldInteractivepressableghostButtoninkButtonmonoliveiconSwaplabelSwapcollapsePanelcodeScrollcodeSurfaceShimmerLabelSwapLabelcn(...)@/lib/utilslib/utils.tsCannot find module '@/components/assistant-ui/thread'elements/.aui@/components/assistant-ui/elements/thread.auiglobals.css@import "tailwindcss"--background--foreground--bordernpx assistant-ui@latest initcreateaddstylecomponents.jsonbase-*--overwritecomponentsuseMemo.auiAssistantRuntimeProviderAuiProviderthreadmarkdown-textelements-agent-plan.auicreateinitrenderToolFallbackgenerative-uimarkdown-textshiki-highlightersyntax-highlightermermaid-diagramthread-listthreadlist-sidebarthread-searchconversation-map