ai-elements

Build AI chat interfaces with shadcn/ui-based React components for conversations, messages, and tools.

Updated Aug 26, 2026
One-click install
npx skills add https://github.com/MohamadJoumaa/Direct --skill ai-elements-mohamadjoumaa
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ai-elements
Source: https://github.com/MohamadJoumaa/Direct/tree/main/.cursor/skills/ai-elements
Command: npx skills add https://github.com/MohamadJoumaa/Direct --skill ai-elements-mohamadjoumaa

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires ai-elements, ai, @ai-sdk/react, zod, lucide-react, nanoid, media-chrome, and includes scripts (resource) and references (resource) components.

What problem does it solve? Building AI chat interfaces from scratch requires assembling message rendering, streaming responses, tool call displays, prompt inputs, and reasoning visualizations, which is repetitive UI work for every AI-powered application. ## Core Features & Use Cases - Pre-built AI UI Components: Install composable React components like Conversation, Message, Prompt Input, Chain of Thought, Code Block, Artifact, Attachments, and Audio Player via a CLI into your own codebase. - AI SDK Integration: Components are designed to work directly with the Vercel AI SDK hooks such as useChat, rendering message parts, tool calls, and speech results. - Full Ownership and Customization: Components are copied into your project (under @/components/ai-elements/) rather than hidden in a library, so you can edit styles and behavior directly. - Use Case: When adding a chatbot to a Next.js app, install the message and conversation components, wire them to useChat, and get a styled streaming chat UI without writing the rendering layer yourself. ## Quick Start Ask the AI to install the ai-elements message and conversation components with the CLI and build a chat page wired to the AI SDK useChat hook.

Frequently Asked Questions about ai-elements

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I install AI Elements components in a Next.js project?

Run npx ai-elements@latest add <component> (or pnpm dlx / bunx depending on your package manager) from your project root. The CLI copies the component code into your components directory, typically @/components/ai-elements/, and installs shadcn/ui automatically if missing.

What components does AI Elements provide for chat UIs?

AI Elements provides Conversation, Message, Prompt Input, Chain of Thought, Code Block, Artifact, Attachments, Checkpoint, Agent, Canvas, and Audio Player components. Each is documented in the references folder with props tables and usage examples.

Does AI Elements work with the Vercel AI SDK?

Yes, AI Elements is designed for the AI SDK. Components like Message render parts from the useChat hook, Agent displays AI SDK Tool objects with input schemas, and AudioPlayer accepts AI SDK SpeechResult data directly.

Why are my AI Elements components not styled after installation?

Unstyled components usually mean shadcn/ui is not configured for Tailwind 4. Ensure your globals.css imports Tailwind and includes the shadcn/ui base styles, and that your tsconfig.json has the @/* path alias configured.

Can I customize AI Elements component styles?

Yes, components are copied into your codebase rather than installed as a hidden library. You can open files like components/ai-elements/message.tsx and edit Tailwind classes directly, and all components accept standard HTML props for extension.