Choosing an AI chat tool often comes down to how much of the interface and request lifecycle you want to build yourself. Vercel AI Elements provides components you can edit in your project, and CopilotKit combines a chat UI with an agent runtime. React Spectrum includes AI-focused components within Adobe’s broader design system.
To compare their usability, I built the same customer support assistant for a fictional SaaS company, Acme Cloud, with all three. The examples use the same model and support instructions.
This qualitative comparison looks at how much setup and chat plumbing each approach requires, along with the control you retain. The findings describe this implementation’s development experience; I haven’t measured runtime performance or response quality.
To follow along, you’ll need a working knowledge of React, Next.js’s App Router, and TypeScript. Install Node.js v22 or later to support the AI SDK dependencies in the example repository, and obtain a Google Gemini API key.
The repository contains separate ai-elements, copilotkit, and spectrum applications. Run npm ci inside the application you want to try to install its locked dependencies.
For the AI Elements and Spectrum apps, set GOOGLE_GENERATIVE_AI_API_KEY in .env.local, as required by the AI SDK Google provider. The CopilotKit app uses GOOGLE_API_KEY, following its model configuration. Keep these keys on the server.
The assistant answers subscription and billing questions for Alex Mercer, an Acme Cloud customer. Each implementation uses Google Gemini and the same support instructions.
Here’s a shortened version of the shared configuration in lib/support.ts:
export const MODEL_ID = "gemini-3-flash-preview";
export const MODE_STRING = `google:${MODEL_ID}`;
export const ACCOUNT_SUMMARY = {
userId: "usr_99241",
name: "Alex Mercer",
plan: "Pro Tier ($49/mo)",
seatsUsed: 4,
totalSeats: 5,
};
export const SUPPORT_INSTRUCTION = `You are a support assistant for Acme Cloud. Help with billing and subscriptions.
Customer: Alex Mercer (Pro Tier, $49/mo, 4/5 seats used, renews on the 1st).
Latest invoice: INV-2043 ($49.00, paid September 1, 2026).
You cannot charge cards or modify subscriptions. If asked, explain the user steps.`;
The account information is a fixed sample record. These examples answer questions about that record and explain account-management steps; they have no connection to a live billing system.
You can find the complete support assistant implementations on GitHub. The snippets below focus on the relevant setup and request flow.
The repository uses AI SDK v7.0.130 in the AI Elements and Spectrum apps, CopilotKit packages at v1.77.0, and @react-spectrum/ai v0.4.0. “CopilotKit v2” below refers to its /v2 API exports.
AI Elements provides UI components that you compose with chat and streaming APIs. CopilotKit adds an agent runtime and React APIs for connecting the assistant to application context.
Here’s the assistant built with Vercel AI Elements:

Vercel AI Elements follows the source distribution approach used by shadcn/ui. Components are copied into your project, where you can inspect and edit them.
This example uses the original Vercel AI Elements components. Its documentation announces deprecation at the end of November 2026 and directs new projects to shadcn/ui AI Elements. Existing copied components remain part of your project.
The original CLI command for adding the components used here is:
npx ai-elements@latest add conversation message prompt-input
I paired AI Elements with the AI SDK. For background on this setup, see our guide to building unified AI interfaces with the Vercel AI SDK.
In app/api/chat/route.ts, I pass messages to streamText() and serialize the response using toUIMessageStreamResponse():
import { convertToModelMessages, streamText, type UIMessage } from "ai";
import { google } from "@ai-sdk/google";
import { MODEL_ID, SUPPORT_INSTRUCTION } from "@/lib/support";
export async function POST(req: Request) {
const { messages }: { messages: UIMessage[] } = await req.json();
const result = streamText({
model: google(MODEL_ID),
system: SUPPORT_INSTRUCTION,
messages: await convertToModelMessages(messages),
});
return result.toUIMessageStreamResponse();
}
toUIMessageStreamResponse() returns an HTTP response using the AI SDK’s UI message stream protocol.
On the client, useChat() connects to /api/chat by default and manages messages and streaming status. The prompt component handles text entry in this example.
I compose the interface by assembling individual primitives:
"use client";
import { useChat } from "@ai-sdk/react";
import { Conversation, ConversationContent, ConversationEmptyState } from "@/components/ai-elements/conversation";
import { Message, MessageContent, MessageResponse } from "@/components/ai-elements/message";
import { PromptInput, PromptInputSubmit, PromptInputTextarea } from "@/components/ai-elements/prompt-input";
export default function VercelAIChatAssistant() {
const { messages, sendMessage, status, stop } = useChat();
return (
<div className="flex h-[650px] w-full max-w-4xl flex-col rounded-xl border bg-background p-6">
<Conversation className="flex-1 overflow-hidden">
<ConversationContent>
{messages.length === 0 ? (
<ConversationEmptyState title="Acme Support" description="Ask about subscriptions or invoices." />
) : null}
{messages.map((m) => (
<Message key={m.id} from={m.role}>
<MessageContent>
{m.parts.map((p, i) => p.type === "text" ? <MessageResponse key={i}>{p.text}</MessageResponse> : null)}
</MessageContent>
</Message>
))}
</ConversationContent>
</Conversation>
<PromptInput onSubmit={(msg) => sendMessage({ text: msg.text })}>
<PromptInputTextarea placeholder="Ask a support question..." />
<PromptInputSubmit status={status} onStop={stop} />
</PromptInput>
</div>
);
}
This composition pattern fits projects that already use Tailwind CSS and shadcn/ui. You have direct control over the layout and can adjust typography or empty states in the copied components.
The tradeoff is that you still write the message-rendering loop and connect the component interactions to the chat hook.
CopilotKit connects an assistant to an agent runtime and application state. Our tutorial on building agentic frontend applications with CopilotKit explores how this approach works in an interactive application.
Install CopilotKit with:
npm install @copilotkit/react-core @copilotkit/runtime
Here’s the assistant built with CopilotKit:

For a Next.js App Router project, place the handler at app/api/copilotkit/[[...slug]]/route.ts. This optional catch-all route covers the base endpoint and its subpaths.
createCopilotRuntimeHandler() returns a handler function. Export that function for the HTTP methods used by the runtime:
import {
BuiltInAgent,
CopilotRuntime,
createCopilotRuntimeHandler,
} from "@copilotkit/runtime/v2";
import { MODE_STRING, SUPPORT_INSTRUCTION } from "@/lib/support";
const runtime = new CopilotRuntime({
agents: {
default: new BuiltInAgent({
model: MODE_STRING,
prompt: SUPPORT_INSTRUCTION,
}),
},
});
const handler = createCopilotRuntimeHandler({
runtime,
basePath: "/api/copilotkit",
});
export const GET = handler;
export const POST = handler;
export const PATCH = handler;
export const DELETE = handler;
CopilotRuntime connects incoming requests to the configured agent.
On the client, CopilotKit provides a prebuilt chat component. First, create a provider in app/providers.tsx and point it to the runtime:
"use client";
import type { ReactNode } from "react";
import { CopilotKitProvider } from "@copilotkit/react-core/v2";
export function Providers({ children }: { children: ReactNode }) {
return (
<CopilotKitProvider runtimeUrl="/api/copilotkit">
{children}
</CopilotKitProvider>
);
}
In your root layout, import @copilotkit/react-core/v2/styles.css and wrap the application’s children in <Providers>. This follows CopilotKit’s provider and stylesheet setup.
The assistant component can then register context and render the chat UI:
"use client";
import { CopilotChat, useAgentContext } from "@copilotkit/react-core/v2";
import { ACCOUNT_SUMMARY } from "@/lib/support";
export default function CopilotKitSupportAssistant() {
useAgentContext({
description: "Sample customer profile and subscription status",
value: ACCOUNT_SUMMARY,
});
return (
<div className="mx-auto h-[650px] w-full max-w-4xl overflow-hidden rounded-xl border bg-background">
<CopilotChat
className="h-full"
labels={{
modalHeaderTitle: "Acme Support Assistant",
welcomeMessageText: "Hello Alex! How can I help you today?",
chatInputPlaceholder: "Ask about your account or billing...",
}}
/>
</div>
);
}
useAgentContext() registers serializable application data with the agent and updates that context when the value changes. In this example, ACCOUNT_SUMMARY is static and repeats account details already supplied in the support instructions.
For this example, CopilotKit was the more direct way to get a working assistant. Once I configured the runtime and provider, I could use the prebuilt chat interface and register account context through a hook.
AI Elements was more intuitive for composing and adjusting the chat UI directly, especially with an existing shadcn/ui and AI SDK setup. Its components are editable in the project, though I still had to connect message rendering and input events to the chat state.
React Spectrum is Adobe’s design system for accessible, internationalized interfaces. Its AI component package, @react-spectrum/ai, includes chat-specific primitives such as Thread and PromptField. Adobe currently labels these components alpha.
For this implementation, I used those components with a custom stream reader and local conversation state. That was an implementation choice: you can also connect Spectrum’s UI to a chat SDK such as the AI SDK.
Here’s the assistant built with React Spectrum:

My Spectrum implementation uses a plain text stream over HTTP. In app/api/chat/route.ts, the AI SDK returns that stream through toTextStreamResponse():
import { streamText } from "ai";
import { google } from "@ai-sdk/google";
import { MODEL_ID, SUPPORT_INSTRUCTION } from "@/lib/support";
export async function POST(req: Request) {
const { messages }: { messages: { role: "user" | "assistant"; content: string }[] } =
await req.json();
const result = streamText({
model: google(MODEL_ID),
system: SUPPORT_INSTRUCTION,
messages,
});
return result.toTextStreamResponse();
}
The client reads the response body as text chunks and appends them to the current assistant message.
With this approach, my client code manages message state and consumes the text stream. After creating a placeholder assistant turn and fetching /api/chat, the core stream-reading logic looks like this:
if (!response.ok || !response.body) {
throw new Error("The assistant request failed.");
}
const reader = response.body
.pipeThrough(new TextDecoderStream())
.getReader();
let text = "";
while (true) {
const { done, value } = await reader.read();
if (done) break;
text += value;
setTurns((current) => current.map((turn) =>
turn.id === assistantId ? { ...turn, text } : turn
));
}
setTurns((current) => current.map((turn) =>
turn.id === assistantId ? { ...turn, streaming: false } : turn
));
The surrounding component stores the turns, appends messages, and connects Spectrum’s Thread and PromptField components to that state. The complete implementation also needs request error handling and cancellation.
Writing the stream reader gave me control over how incoming text updates the conversation, along with responsibility for maintaining that behavior. Pairing Spectrum with useChat() and a compatible transport would reduce this work.
Here’s how the three implementations compare:
| Criteria | Vercel AI Elements + AI SDK | CopilotKit v2 APIs | React Spectrum AI components |
|---|---|---|---|
| Category | Editable AI UI components paired with chat and streaming APIs | Agent runtime with React UI and context APIs | AI-focused UI components within a broader design system |
| Delivery | Components copied into project source | npm packages under @copilotkit/* |
npm packages under @react-spectrum/* |
| Setup | Add components and configure an AI SDK route | Configure the runtime, provider, and agent | Connect UI components to application state and a chosen chat backend |
| Application context | Supply context through the request or server-side model input | Register client context with useAgentContext() |
Supply context through application code; this example sends message history |
| Stream handling | AI SDK UI message stream consumed by useChat() |
CopilotKit runtime and client handle the agent event stream | Custom text-stream reader in this example; a chat SDK is also an option |
| Transport | AI SDK default HTTP transport; configurable through useChat() |
CopilotKit runtime endpoints | Plain HTTP text streaming in this example; chosen by the application |
| Accessibility | Depends on component choices and the completed interface | Depends on the chosen UI and completed interface | Design-system accessibility support; the completed interface still needs testing |
| Styling | Direct edits to copied source | Prebuilt UI with customization APIs and support for custom interfaces | Spectrum component APIs and design tokens |
The setup effort depends on the features you need and the libraries already in your application. The custom stream reader accounts for part of the additional work in my Spectrum implementation.
Choose based on the interface you want to build and the application infrastructure you already have. Each option leaves different integration work to your code.
CopilotKit fits an in-app assistant connected to an agent runtime and application context. useAgentContext() registers serializable data with the agent, and <CopilotChat /> handles much of the conversation UI.
You still need to configure the provider and runtime. A production application must also authenticate requests and validate access to account data on the server.
AI Elements fits projects where you want component source in your repository and prefer to compose the chat experience with React components and AI SDK APIs. For new projects, start with the shadcn/ui AI Elements documentation linked in the setup section.
Choose React Spectrum when its design conventions and accessibility features align with your product’s needs. Our guide to building accessible interfaces with React Aria covers the foundations of Adobe’s component ecosystem.
You’ll need to choose a chat backend and connect it to Spectrum’s AI components. Account for the AI package’s alpha status when evaluating it for production.
In this implementation, CopilotKit offered the most direct route to a working assistant. I found AI Elements useful for adjusting the chat UI in source, and Spectrum gave me components that fit Adobe’s design system.
The extra streaming code in my Spectrum version came from my choice to manage the response myself. If you want Spectrum’s UI with less custom state handling, use a chat SDK to manage the conversation and stream.
Install LogRocket via npm or script tag. LogRocket.init() must be called client-side, not
server-side
$ npm i --save logrocket
// Code:
import LogRocket from 'logrocket';
LogRocket.init('app/id');
// Add to your HTML:
<script src="https://cdn.lr-ingest.com/LogRocket.min.js"></script>
<script>window.LogRocket && window.LogRocket.init('app/id');</script>

Can React Resizable Panels’ Workspace replace Dockview or FlexLayout? Compare bundle size, tab state, and accessibility.

Learn to build a Python-based PDF search app with Typesense, embeddings, and semantic retrieval.

Explore modern CSS masonry layouts with display: grid-lanes, interactive demos, browser support, and CSS column fallbacks.

Build a Claude Code harness with saved plans, tool hooks, and milestone checks for frontend work that spans sessions.
Would you be interested in joining LogRocket's developer community?
Join LogRocket’s Content Advisory Board. You’ll help inform the type of content we create and get access to exclusive meetups, social accreditation, and swag.
Sign up now