published fresh until

Vercel AI Elements: how do I build a chat UI for an AI app?

Summary As of November 2026, [AI Elements is moving to shadcn/ui](https://ui.shadcn.com/docs/ai-elements); existing copied components need no immediate migration. For a new chat pattern, install its components with pnpm dlx shadcn@latest add message-scroller message bubble input-group

Not for a streaming chatbot backend or assistant-ui chat; see case-ai-chatbot-app-streaming-replies-chat-ui-resume-nextjs-ai-sdk

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

As of November 2026, start new chat UI from shadcn/ui's AI Elements patterns. Do first: choose the new-project route or the existing-component migration route before asking the agent to add components.

The problem

You are building a chatbot or assistant screen on the Vercel AI SDK and want streaming messages, a prompt box with attachments and a model picker, without the agent inventing each piece.

What the source says

The original Vercel AI Elements repository announces deprecation at the end of November 2026 and directs new projects to shadcn/ui. Its old npx ai-elements@latest add <component> flow and Conversation API belong to that earlier registry, rather than the new-project instructions below.

The replacement is a set of compositions copied into your project, with no separate AI Elements package. Existing copied components need no immediate migration; each pattern page provides a migration prompt intended to preserve wrapper exports and props. Introduction and migration guide.

  • Chat uses Message Scroller, Message, Bubble and Input Group. Its install command is pnpm dlx shadcn@latest add message-scroller message bubble input-group.
  • Prompt Input uses Input Group, Attachment and Dropdown Menu: pnpm dlx shadcn@latest add input-group attachment dropdown-menu.
  • Model Selector uses Dropdown Menu and Input Group, with menus for the model and effort.
  • Tool uses Trace and Code Block. Its migration prompt preserves the old wrapper exports while rebuilding their rendering.

How to describe it to the agent

Suggested prompt:

Build the chat page from the current shadcn/ui Chat, Prompt Input and Model Selector patterns linked above. Install their listed components, copy their compositions, and connect the page to the AI SDK. Use Message Scroller for the thread. Keep my theme tokens. For existing files in components/ai-elements, use the relevant migration prompt and preserve their exports and props. Show the diff and run the type checker.

Mistakes to check

  • Mixing the earlier registry's component names and install commands with the new shadcn/ui patterns. Use one documented route. Migration guide.
  • Treating the model picker as the backend connection: keep the UI selection and your backend request in sync. The Model Selector pattern supplies the selection controls.
  • Dropping tool output when rendering messages: the Tool pattern describes rendering tool parts and their states.

Limits

A UI pattern still needs your backend and application behavior. Existing copied code can remain in place while you decide whether to migrate. Migration guide.

Sources

Started from a post by @Vercel (ai-elements), packaged by the editor. Original post

Subjects

More in agent skills

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Vercel AI Elements: how do I build a chat UI for an AI app?
Summary: As of November 2026, [AI Elements is moving to shadcn/ui](https://ui.shadcn.com/docs/ai-elements); existing copied components need no immediate migration. For a new chat pattern, install its components with `pnpm dlx shadcn@latest add message-scroller message bubble input-group`
Copy for agent
get the whatworks thread ai-elements-chat-ui-vercel-ai-sdk and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread ai-elements-chat-ui-vercel-ai-sdk
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks