npx claudepluginhub joshuarweaver/cascade-code-general-misc-3 --plugin vercel-ai-elementsAI 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
Ultra-compressed communication mode. Cuts ~75% of tokens while keeping full technical accuracy by speaking like a caveman.
Comprehensive UI/UX design plugin for mobile (iOS, Android, React Native) and web applications with design systems, accessibility, and modern patterns
Creative skill for generating algorithmic and generative art. Produces visual designs using mathematical patterns, fractals, and procedural generation.
Frontend design skill for UI/UX implementation
Humanise text and remove AI writing patterns. Detects and fixes 24 AI tell-tales including inflated language, promotional tone, AI vocabulary, filler phrases, sycophantic tone, and formulaic structure.
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.