A component library and custom registry built on top of shadcn/ui to help you build AI-native applications faster.
Installs all 48 components. Without our CLI, run instead.
AI Elements publishes a shadcn registry at ai-sdk.dev, with 48 components installable through the shadcn CLI.
Copy a prompt for your agent, copy the install command, or open the docs that ship it.
AI-powered agent component.
AI-powered artifact component.
AI-powered attachments component.
AI-powered audio player component.
AI-powered canvas component.
AI-powered chain of-thought component.
AI-powered checkpoint component.
AI-powered commit component.
AI-powered confirmation component.
AI-powered connection component.
AI-powered context component.
AI-powered controls component.
AI-powered edge component.
AI-powered environment variables component.
AI-powered file tree component.
AI-powered image component.
AI-powered jsx preview component.
AI-powered mic selector component.
AI-powered model selector component.
AI-powered node component.
AI-powered open in-chat component.
AI-powered package info component.
AI-powered panel component.
AI-powered persona component.
AI-powered plan component.
AI-powered prompt input component.
AI-powered queue component.
AI-powered reasoning component.
AI-powered sandbox component.
AI-powered schema display component.
AI-powered shimmer component.
AI-powered snippet component.
AI-powered speech input component.
AI-powered stack trace component.
AI-powered terminal component.
AI-powered test results component.
AI-powered tool component.
AI-powered toolbar component.
AI-powered transcription component.
AI-powered voice selector component.
AI-powered web preview component.
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
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 (
{messages.map((message, index) => (
{message.content}
))}
);
}
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
AI Elements is a component library on 21st.dev by Vercel with 11 public React components. Every component ships with a live interactive preview and full TSX source — copy the code, install it through the shadcn CLI, or pull it into Cursor or Claude Code over MCP.