vercel/ai-elements
AI Elements is a component library and custom registry built on top of shadcn/ui to help you build AI-native applications faster.
What is AI Elements?
AI Elements is a React component library that ships ready‑made UI pieces for building AI‑focused web apps. It sits on top of the popular shadcn/ui design system and works with Next.js, Tailwind CSS, and Vercel’s AI SDK. The library provides components such as conversation windows, message bubbles, code‑block displays, and reasoning panels, letting developers focus on the AI logic rather than UI plumbing.
Who might use it?
- Front‑end engineers building chat‑bots, code‑assistants, or any app that shows AI‑generated text or code.
- Teams already using Next.js, shadcn/ui, and Tailwind who want a quick, consistent UI for AI interactions.
- Open‑source contributors who want to extend a set of AI‑specific UI components.
How does it work?
- CLI‑driven installation – Run
npx ai-elements@latest(or the shadcn CLI) and the tool detects your package manager, pulls a component registry fromhttps://elements.ai-sdk.dev/api/registry/registry.json, and adds the selected components to your project’s shadcn/ui component folder. - Component usage – After installation you import the components like any other React component, e.g.
Conversation,Message,CodeBlock, and compose them with data from the AI SDK (useChat). - Customization – Because the components live in your source tree, you can edit their Tailwind classes, replace markup, or extend them just like any shadcn/ui component.
What can you build with it?
Anything that needs a polished AI‑native interface:
- Chat interfaces that render a stream of messages.
- Code‑assistant panels that display syntax‑highlighted snippets.
- Reasoning or step‑by‑step explanation views.
- Any UI that benefits from the conversational patterns that AI models produce.
How to get started?
# Install all components (recommended)
npx ai-elements@latest
# Or add a single component
npx ai-elements@latest add message
Then, in a Next.js page/component:
import { useChat } from "@ai-sdk/react";
import { Conversation, Message, MessageContent, MessageResponse } from "@/components/ai-elements/message";
export default function Chat() {
const { messages } = useChat();
return (
<Conversation>
<ConversationContent>
{messages.map((msg, i) => (
<Message key={i} from={msg.role}>
<MessageContent>
<MessageResponse>{msg.content}</MessageResponse>
</MessageContent>
</Message>
))}
</ConversationContent>
</Conversation>
);
}
What’s next?
The repo is slated for deprecation in November 2026; Vercel is moving the library into the shadcn/ui ecosystem under a new name. Existing projects can keep using the current package, but new projects should watch for the shadcn/ui‑based version.
TL;DR – AI Elements is a UI kit for AI‑centric Next.js apps, delivered via a CLI that plugs pre‑built, Tailwind‑styled React components into a shadcn/ui setup. It speeds up building chat‑style interfaces and code‑display widgets, and is maintained by Vercel.
Related
- Project
- Project
- Project
- Project
- Project