Loading...
Loading...
Build AI agent interfaces with Polpo UI — composable React chat components, CLI tools, and starter templates. Use when the user wants to create a chat app, add chat components, install @polpo-ai/chat, scaffold a Polpo project, configure theming/dark mode, use ChatInput, ChatMessage, ChatSessionList, or any Polpo UI component. Triggers on "polpo ui", "chat UI", "chat component", "@polpo-ai/chat", "@polpo-ai/ui", "create-polpo-app", "chat input", "session list", "agent selector", "chat interface", "polpo chat", "chat widget", "multi-agent".
npx skill4agent add lumea-labs/polpo-skills polpo-ui# Interactive
npx create-polpo-app
# Non-interactive (CI / AI agents)
npx create-polpo-app my-app -t chat -y
npx create-polpo-app my-app -t chat-widget -y
npx create-polpo-app my-app -t multi-agent -y# Interactive multi-select
npx @polpo-ai/ui add
# Non-interactive
npx @polpo-ai/ui add --all
npx @polpo-ai/ui add tools hooks --overwritenpm install @polpo-ai/chat @polpo-ai/sdk @polpo-ai/react react-virtuoso lucide-react streamdown/* Tailwind v4 */
@source "../node_modules/@polpo-ai/chat/dist/**/*.js";// Tailwind v3 — tailwind.config.js
content: ["./node_modules/@polpo-ai/chat/dist/**/*.js"]import { PolpoProvider } from "@polpo-ai/react";
// baseUrl is root URL — SDK appends /v1/ internally. Do NOT add /v1/.
<PolpoProvider baseUrl="https://api.polpo.sh" apiKey={process.env.NEXT_PUBLIC_POLPO_API_KEY} autoConnect={false}>
{children}
</PolpoProvider><Chat agent="coder" sessionId="session_abc" /><Chat agent="coder" avatar={<Avatar />}>
<MyCustomInput />
</Chat>import { ChatMessage, ChatSkeleton } from "@polpo-ai/chat";
import { useChat } from "@polpo-ai/react";<Chat agent="coder" onSessionCreated={(id) => router.replace(`/chat/${id}`)}>
{({ hasMessages }) => hasMessages ? <ChatInput /> : <LandingPage />}
</Chat>onSessionCreated<Chat onSessionCreated={(id) => router.push(`/chat/${id}`)} />| Component | Purpose |
|---|---|
| Root compound — Provider + Messages + Input |
| Textarea + submit + file attach + drag & drop |
| Message dispatcher (user/assistant) |
| Virtuoso list with auto-scroll |
| Context wrapping useChat + useFiles |
| Flat session list with select/delete |
| Sessions grouped by agent |
| Agent picker dropdown |
| Suggestion button grid |
| Ask-user-question wizard |
| Landing + greeting + input + suggestions |
| Scroll-to-bottom indicator |
| Loading skeleton |
| Typing dots |
| Auto-dispatching tool renderer |
| Base tool renderer with expand/collapse |
const { messages, sendMessage, isStreaming, abort, uploadFile, pendingToolCall } = useChatContext();
const handleSubmit = useSubmitHandler(sendMessage, uploadFile);
const dragging = useDocumentDrag();