ai-elements

Build AI chat interfaces with shadcn/ui-based React components for Next.js applications.

Updated May 12, 2026
One-click install
npx skills add https://github.com/ahemdatef/Gradution-Project-iLMS-Software --skill ai-elements-ahemdatef
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ai-elements
Source: https://github.com/ahemdatef/Gradution-Project-iLMS-Software/tree/main/frontend/.agents/skills/ai-elements
Command: npx skills add https://github.com/ahemdatef/Gradution-Project-iLMS-Software --skill ai-elements-ahemdatef

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 implementing conversations, message rendering, tool call displays, prompt inputs, and streaming responses, which is repetitive and time-consuming for React developers. ## Core Features & Use Cases - Pre-built AI Components: Install composable components like Conversation, Message, CodeBlock, ChainOfThought, Artifact, Attachments, and AudioPlayer directly into your codebase via CLI. - AI SDK Integration: Components are designed to work with the Vercel AI SDK's useChat hook, tool types, and speech results for streaming chat experiences. - Full Customization: Since component code lives in your project under components/ai-elements/, you can modify styles, props, and behavior directly. - Use Case: Add a chatbot to a Next.js app by installing the message and conversation components, then wiring them to useChat to render streaming AI responses with syntax-highlighted code blocks. ## Quick Start Use the ai-elements skill to add a chat interface with messages and a prompt input to my Next.js project.

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 Next.js?

Run npx ai-elements@latest add <component> from your project root, substituting your package runner like pnpm dlx if needed. The CLI downloads the component code into your components/ai-elements directory and installs shadcn/ui automatically if missing.

How do I use AI Elements with the Vercel AI SDK?

Import components like Message and MessageContent, then map over the messages array returned by the useChat hook from @ai-sdk/react. Render text parts with MessageResponse to display streaming AI output.

Does AI Elements require shadcn/ui to work?

Yes, AI Elements is built on top of shadcn/ui and Tailwind CSS. If shadcn/ui is not installed, running any AI Elements install command will automatically set it up for you.

Why are my AI Elements components not styled?

Unstyled components usually mean your project is not configured for shadcn/ui with Tailwind 4. Ensure your globals.css imports Tailwind and includes the shadcn/ui base styles.

Why do AI Elements imports fail with module not found?

Check that the component file exists and that tsconfig.json defines a paths alias mapping @/* to ./*. The components import using the @/components/ai-elements/ prefix by default.

Can I customize AI Elements component styles?

Yes, components are copied into your codebase rather than hidden in a library, so you can edit the files directly. They also accept standard HTML attributes and className props for styling overrides.