Help us improve
Share bugs, ideas, or general feedback.
From assistant-ui
Guides access to assistant-ui runtime state and operations for threads, messages, composer, and events using React hooks like useAui, useAuiState. Use for chat UI state management.
npx claudepluginhub assistant-ui/skills --plugin assistant-uiHow this skill is triggered — by the user, by Claude, or both
Slash command
/assistant-ui:runtimeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Always consult [assistant-ui.com/llms.txt](https://assistant-ui.com/llms.txt) for latest API.**
Guides on assistant-ui React library for AI chat UI components, covering architecture, runtime adapters like AI SDK and LangGraph, packages, and debugging.
Implements OpenAI Assistants API v2 for stateful chatbots using threads, runs, Code Interpreter, File Search, RAG, and vector stores. Handles polling, errors like active runs, and migration to Responses API.
React component library for AI-powered UI: chat interfaces, tool execution visualization, reasoning displays, and workflow management. 30+ components installed via shadcn registry.
Share bugs, ideas, or general feedback.
Always consult assistant-ui.com/llms.txt for latest API.
AssistantRuntime
├── ThreadListRuntime (thread management)
│ ├── ThreadListItemRuntime (per-thread item)
│ └── ...
└── ThreadRuntime (current thread)
├── ComposerRuntime (input state)
└── MessageRuntime[] (per-message)
└── MessagePartRuntime[] (per-content-part)
import { useAui, useAuiState, useAuiEvent } from "@assistant-ui/react";
function ChatControls() {
const api = useAui();
const messages = useAuiState(s => s.thread.messages);
const isRunning = useAuiState(s => s.thread.isRunning);
useAuiEvent("composer.send", (e) => {
console.log("Sent in thread:", e.threadId);
});
return (
<div>
<button onClick={() => api.thread().append({
role: "user",
content: [{ type: "text", text: "Hello!" }],
})}>
Send
</button>
{isRunning && (
<button onClick={() => api.thread().cancelRun()}>Cancel</button>
)}
</div>
);
}
const api = useAui();
const thread = api.thread();
// Append message
thread.append({ role: "user", content: [{ type: "text", text: "Hello" }] });
// Cancel generation
thread.cancelRun();
// Get current state
const state = thread.getState(); // { messages, isRunning, ... }
const message = api.thread().message(0); // By index
message.edit({ role: "user", content: [{ type: "text", text: "Updated" }] });
message.reload();
useAuiEvent("thread.runStart", () => {});
useAuiEvent("thread.runEnd", () => {});
useAuiEvent("composer.send", ({ threadId }) => {
console.log("Sent in thread:", threadId);
});
useAuiEvent("thread.modelContextUpdate", () => {});
const caps = useAuiState(s => s.thread.capabilities);
// { cancel, edit, reload, copy, speak, attachments }
// Get messages
const messages = useAuiState(s => s.thread.messages);
// Check running state
const isRunning = useAuiState(s => s.thread.isRunning);
// Append message
api.thread().append({ role: "user", content: [{ type: "text", text: "Hi" }] });
// Cancel generation
api.thread().cancelRun();
// Edit message
api.thread().message(index).edit({ ... });
// Reload message
api.thread().message(index).reload();
"Cannot read property of undefined"
AssistantRuntimeProviderState not updating
useAuiState to prevent unnecessary re-rendersMessages array empty