By vercel
Rapidly assemble AI-powered chat UIs with reusable components for conversation flows, tool displays, and prompt inputs, leveraging Next.js, shadcn/ui, and the Vercel AI SDK.
AI Elements is a component library built on top of shadcn/ui to help you build AI-native applications faster.
AI Elements provides pre-built, customizable React components specifically designed for AI applications, including conversations, messages, code blocks, reasoning displays, and more. The CLI makes it easy to add these components to your Next.js project.
You can use the AI Elements CLI directly with npx, or install it globally:
# Use directly (recommended)
npx ai-elements@latest
# Or using shadcn cli
npx shadcn@latest add https://elements.ai-sdk.dev/api/registry/all.json
Before using AI Elements, ensure your project meets these requirements:
npx shadcn@latest init)Install all available AI Elements components at once:
npx ai-elements@latest
This command will:
Install individual components using the add command:
npx ai-elements@latest add <component-name>
Examples:
# Install the message component
npx ai-elements@latest add message
# Install the conversation component
npx ai-elements@latest add conversation
# Install the code-block component
npx ai-elements@latest add code-block
You can also install components using the standard shadcn/ui CLI:
# Install all components
npx shadcn@latest add https://elements.ai-sdk.dev/api/registry/all.json
# Install a specific component
npx shadcn@latest add https://elements.ai-sdk.dev/api/registry/message.json
After installing components, you can use them in your React application:
"use client";
import { useChat } from "@ai-sdk/react";
import {
Conversation,
ConversationContent,
} from "@/components/ai-elements/conversation";
import {
Message,
MessageContent,
MessageResponse,
} from "@/components/ai-elements/message";
export default function Chat() {
const { messages } = useChat();
return (
<Conversation>
<ConversationContent>
{messages.map((message, index) => (
<Message key={index} from={message.role}>
<MessageContent>
<MessageResponse>{message.content}</MessageResponse>
</MessageContent>
</Message>
))}
</ConversationContent>
</Conversation>
);
}
The AI Elements CLI:
https://elements.ai-sdk.dev/api/registry/registry.jsonComponents are installed to your configured shadcn/ui components directory (typically @/components/ai-elements/) and become part of your codebase, allowing for full customization.
AI Elements uses your existing shadcn/ui configuration. Components will be installed to the directory specified in your components.json file.
For the best experience, we recommend:
AI_GATEWAY_API_KEY to your .env.localIf you'd like to contribute to AI Elements, please follow these steps:
packages/elements.main branch.Made with ❤️ by Vercel
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Expert guidance for Next.js Cache Components and Partial Prerendering (PPR). Proactively activates in projects with cacheComponents: true, providing patterns for 'use cache' directive, cacheLife(), cacheTag(), cache invalidation, and parameter permutation rendering.
Monorepo build system and task orchestrator for managing large-scale JavaScript/TypeScript projects efficiently.
Command-line interface for deploying and managing applications on Vercel's serverless platform. Built for developers automating deployment workflows.
Vercel skill for streaming and markdown processing. Useful for handling large document transformations and real-time content processing.
AI skill for initializing and setting up Vercel workflows. Bootstrap automation projects with workflow scaffolding and configuration.
npx claudepluginhub vercel/ai-elementsshadcn/ui AI chat components for conversational interfaces. Use for streaming chat, tool/function displays, reasoning visualization, or encountering Next.js App Router setup, Tailwind v4 integration, AI SDK v5 migration errors.
Build agents that speak your UI
Build generative UI with OpenUI — any LLM provider, any backend language. Scaffold, integrate, validate.
Modular Vercel AI SDK development plugin with 13 specialized agents, parallel orchestration, and AI SDK v6 support. Features AI Elements (54 components), 107+ providers, Tools Registry, MCP integration, and full-stack app builder.
Skills for building AI chat interfaces with assistant-ui React library
Frontend component development with accessibility and responsive design