About ai-sdk-ui-v7
A skill for developers building chat interfaces with `@ai-sdk/react` and `useChat` on AI SDK v7. It covers client-side message handling and streaming UI patterns, while directing backend generation work to ai-sdk-core.
Key features
- 01Version-specific useChat guidance
- 02DefaultChatTransport configuration
- 03Local input and message rendering patterns
- 04Streaming UI response guidance
- 05Chat UI code templates
Use cases
- 01Building a React chat interface
- 02Connecting chat to a custom API endpoint
- 03Rendering messages with parts and status
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ blockmatic/ basilic-skills --skill ai-sdk-ui-v7After installing, type/ai-sdk-ui-v7in Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
templates/nextjs-api-route.tsnextjs-chat-app-router.tsxuse-chat-basic.tsxDetails
From the project READMESkill: ai-sdk-ui
Scope
- Applies to:
@ai-sdk/reactuseChatandDefaultChatTransportfromai - Does NOT cover: Backend generation (see ai-sdk-core)
Assumptions
- SDK major is
ai^7;@ai-sdk/reactis a separate package major. Folder followsai - Never write
useChatfrom memory. Grepnode_modules/@ai-sdk/react/docs/andnode_modules/ai/docs/, else https://ai-sdk.dev/docs/ai-sdk-ui/chatbot - Chat HTTP may be Fastify; pass
transportwhen the URL is not/api/chat
Principles
useChatfrom@ai-sdk/react;DefaultChatTransportfromai- Local input state;
sendMessage({ text });statusnotisLoading; rendermessage.parts - Server: see ai-sdk-core. Handlers use
createUIMessageStreamResponse+toUIMessageStream({ stream: result.stream }). Leave deprecatedtoUIMessageStreamResponse()only when the task is unrelated to streaming or the SDK
Constraints
MUST
DefaultChatTransport({ api })when the endpoint is not/api/chat- Disable send while
status !== 'ready'
AVOID
import { useChat } from 'ai/react'toDataStreamResponse/pipeDataStreamToResponse- Pre-v5
handleInputChange/handleSubmit/useAssistant
Interactions
- Uses ai-sdk-core
- Complements fastify, next
Templates
Comments
Markdown supported