ai-elements
Skill8 starsChanged 30 days agoApache-2.0View on GitHub
Build AI chat interfaces using ai-elements components — conversations, messages, tool displays, prompt inputs, and more. Use when the user wants to build a chatbot, AI assistant UI, or any AI-powered chat interface.
- Reads credentials
33 other projects use a version of this, 27 of them edited.
Adopted by
Most recently taken up by
- yuan-alex/cedaredited, first seen Nov 8, 2026
- Fractera/Agent-Engineering-Infrastructureedited, first seen Nov 8, 2026
- Fractera/Agentic-Engineering-Infrastructureedited, first seen Nov 8, 2026
- AxlZero21/Skillstheir own version, first seen Nov 8, 2026
- skillpie/ZCodeOnlineedited, first seen Nov 5, 2026
- ZCodium-project/ZCodiumedited, first seen Nov 1, 2026
Used with
Projects with it also use e2e-case-lifecycle, zcode-large-task-fixture and 6 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
ZCodium-projectSkille2e-case-lifecycle
Plan, maintain, replay, and promote ZCode desktop E2E cases and their fixtures, coverage matrices, and CI admission evidence.
Also in 3 projects that use this
ZCodium-projectSkillzcode-large-task-fixture
Generate, verify, or remove large synthetic ZCode task fixtures in local ~/.zcode persistence for UI/session performance testing. Use when testing big conversation/task rendering, task list performance, snapshot recovery, tool-call rendering, reasoning, patches, todos, and model usage without spending time chatting manually.
Also in 3 projects that use this
crafter-stationSkillcreate-element
Create new UI elements for tryelements.dev registry. Use when: (1) Adding new UI components (buttons, inputs, cards), (2) Building integration components (Clerk, Stripe, Uploadthing), (3) Creating theme-related elements, (4) Any shadcn-style registry component. IMPORTANT: For logo components with variants (icon/wordmark/logo + dark/light), use the logo-with-variants skill instead. This skill includes scaffolding, registry schema, and component patterns. ALWAYS use Context7 MCP to fetch latest dependency docs before implementing.
Also in 3 projects that use this
anasahmed07Skillcreate-auth-skill
Skill for creating auth layers in TypeScript/JavaScript apps using Better Auth.
Also in 4 projects that use this
VercelSkillai-sdk
Answer questions about the AI SDK and help build AI-powered features. Use when developers: (1) Ask about AI SDK functions like generateText, streamText, ToolLoopAgent, embed, or tools, (2) Want to build AI agents, chatbots, RAG systems, or text generation features, (3) Have questions about AI providers (OpenAI, Anthropic, Google, etc.), streaming, tool calling, structured output, or embeddings, (4) Use React hooks like useChat or useCompletion. Triggers on: "AI SDK", "Vercel AI SDK", "generateText", "streamText", "add AI to my app", "build an agent", "tool calling", "structured output", "useChat".
Also in 13 projects that use this
anasahmed07Skillbetter-auth-best-practices
Skill for integrating Better Auth - the comprehensive TypeScript authentication framework.
Also in 6 projects that use this
Other versions33 projects use a version of this.
Word for word · 0
None found.
Edited · 27
- trycompai/crm★ 12k100% same
- zai-org/ZCode★ 8.6k100% same
- vercel/ai-elements★ 2.5k100% same
- xiaoiver/infinite-canvas-tutorial★ 1.1k93% same
- subhadeeproy3902/mvpblocks★ 834100% same
- mxyhi/ok-skills★ 511100% same
- marian2js/opengoat★ 42793% same
- jihe520/mindpocket★ 34993% same
- oasm-platform/open-asm★ 272100% same
- ZCodium-project/ZCodium★ 248100% same
17 more not listed
Wrote their own version · 6
- openai/plugins★ 7.8ksame name
- crafter-station/elements★ 524same name
- laguagu/claude-code-nextjs-skills★ 72same name
- trancethehuman/template-next-agent★ 3same name
- AxlZero21/Skills★ 1same name
- mm-mazhar/agent-skills-config★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/skills/react-best-practices/AGENTS.mdAGENTS.md
- agent-browserSkill
- architecture-governanceSkill
- dep-refsSkill
- dogfoodSkill
- electronSkill
- feature-boundary-plannerSkill
- vercel-react-best-practicesSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. 9 are common, 0 are distinctive, and 4 are very specific to this project.
9
Common
Most of the 31 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Common: line 23
Before installing AI Elements, make sure your environment meets the following requirements:
- Common: line 36
After running the command, you should see a confirmation in your terminal that the files were added.
- Common: line 44
After installing AI Elements components, you can use them in your application like any other React component.
- Very specific: line 80
All AI Elements components take as many primitive attributes as possible.
- Common: line 84
After installation, no additional setup is needed.
- Very specific: line 107
Make sure your project is configured correctly for shadcn/ui in Tailwind 4 - this means having a globals.css file that imports Tailwind and …
- Common: line 121
If all else fails, feel free to open an issue on GitHub.
- Very specific: line 125
Ensure your app is using the same data-theme system that shadcn/ui and AI Elements expect.
- Very specific: line 129
Check the file exists. If it does, make sure your tsconfig.json has a proper paths alias for @/ i.e.
- Common: line 144
Verify your config file syntax is valid JSON.
- Common: line 145
Check that the file path is correct for your AI tool.
- Common: line 147
Ensure you have a stable internet connection.
- Common: line 151
If none of these answers help, open an issue on GitHub and someone will be happy to assist.
“Common” is measured: kept by at least 6 in 10 of the 31 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!--
Derived from vercel/ai-elements (skills/ai-elements/SKILL.md).
Copyright 2023 Vercel, Inc. Licensed under Apache-2.0.
Modified by CCbuddy: local integration, formatting and adaptations.
See THIRD-PARTY-NOTICES.md in the repository root for license and provenance.
-->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. It provides pre-built components like conversations, messages and more.
Installing AI Elements is straightforward and can be done in a couple of ways. You can use the dedicated CLI command for the fastest setup, or integrate via the standard shadcn/ui CLI if you've already adopted shadcn's workflow.
IMPORTANT: Run all CLI commands using the project's package runner:
npx ai-elements@latest,pnpm dlx ai-elements@latest, orbunx --bun ai-elements@latest— based on the project'spackageManager. Examples below usenpx ai-elements@latestbut substitute the correct runner for the project.
Prerequisites
Before installing AI Elements, make sure your environment meets the following requirements:
- Node.js, version 18 or later
- A Next.js project with the AI SDK installed.
- shadcn/ui installed in your project. If you don't have it installed, running any install command will automatically install it for you.
- We also highly recommend using the AI Gateway and adding
AI_GATEWAY_API_KEYto yourenv.localso you don't have to use an API key from every provider. AI Gateway also gives $5 in usage per month so you can experiment with models. You can obtain an API key here.
Installing Components
You can install AI Elements components using either the AI Elements CLI or the shadcn/ui CLI. Both achieve the same result: adding the selected component’s code and any needed dependencies to your project.
The CLI will download the component’s code and integrate it into your project’s directory (usually under your components folder). By default, AI Elements components are added to the @/components/ai-elements/ directory (or whatever folder you’ve configured in your shadcn components settings).
After running the command, you should see a confirmation in your terminal that the files were added. You can then proceed to use the component in your code.
Usage
Once an AI Elements component is installed, you can import it and use it in your application like any other React component. The components are added as part of your codebase (not hidden in a library), so the usage feels very natural.
Example
After installing AI Elements components, you can use them in your application like any other React component. For example:
"use client";
import { Message, MessageContent, MessageResponse } from "@/components/ai-elements/message";
import { useChat } from "@ai-sdk/react";
const Example = () => {
const { messages } = useChat();
return (
<>
{messages.map(({ role, parts }, index) => (
<Message from={role} key={index}>
<MessageContent>
{parts.map((part, i) => {
switch (part.type) {
case "text":
return <MessageResponse key={`${role}-${i}`}>{part.text}</MessageResponse>;
}
})}
</MessageContent>
</Message>
))}
</>
);
};
export default Example;In the example above, we import the Message component from our AI Elements directory and include it in our JSX. Then, we compose the component with the MessageContent and MessageResponse subcomponents. You can style or configure the component just as you would if you wrote it yourself – since the code lives in your project, you can even open the component file to see how it works or make custom modifications.
Extensibility
All AI Elements components take as many primitive attributes as possible. For example, the Message component extends HTMLAttributes<HTMLDivElement>, so you can pass any props that a div supports. This makes it easy to extend the component with your own styles or functionality.
Customization
After installation, no additional setup is needed. The component’s styles (Tailwind CSS classes) and scripts are already integrated. You can start interacting with the component in your app immediately.
For example, if you'd like to remove the rounding on Message, you can go to components/ai-elements/message.tsx and remove rounded-lg as follows:
export const MessageContent = ({ children, className, ...props }: MessageContentProps) => (
<div
className={cn(
"flex flex-col gap-2 text-sm text-foreground",
"group-[.is-user]:bg-primary group-[.is-user]:text-primary-foreground group-[.is-user]:px-4 group-[.is-user]:py-3",
className,
)}
{...props}
>
<div className="is-user:dark">{children}</div>
</div>
);Troubleshooting
Why are my components not styled?
Make sure your project is configured correctly for shadcn/ui in Tailwind 4 - this means having a globals.css file that imports Tailwind and includes the shadcn/ui base styles.
I ran the AI Elements CLI but nothing was added to my project
Double-check that:
- Your current working directory is the root of your project (where
package.jsonlives). - Your components.json file (if using shadcn-style config) is set up correctly.
- You’re using the latest version of the AI Elements CLI:
npx ai-elements@latestIf all else fails, feel free to open an issue on GitHub.
Theme switching doesn’t work — my app stays in light mode
Ensure your app is using the same data-theme system that shadcn/ui and AI Elements expect. The default implementation toggles a data-theme attribute on the <html> element. Make sure your tailwind.config.js is using class or data- selectors accordingly.
The component imports fail with “module not found”
Check the file exists. If it does, make sure your tsconfig.json has a proper paths alias for @/ i.e.
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./*"]
}
}
}My AI coding assistant can't access AI Elements components
- Verify your config file syntax is valid JSON.
- Check that the file path is correct for your AI tool.
- Restart your coding assistant after making changes.
- Ensure you have a stable internet connection.
Still stuck?
If none of these answers help, open an issue on GitHub and someone will be happy to assist.
Available Components
See the references/ folder for detailed documentation on each component.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

