ai-elements
Was er macht
Er führt die KI durch das Hinzufügen von KI-Chat-Komponenten zu einem Next.js-Projekt. Die Komponenten basieren auf shadcn/ui. Er ist für Entwickler gedacht, die Chatbots oder KI-Assistenten-Bildschirme bauen.
Wann du ihn nutzt
- ✓Wenn du einen Chatbot oder einen KI-Assistenten-Bildschirm in einer Next.js-App bauen möchtest.
- ✓Wenn du fertige Komponenten für Chat-Nachrichten, Werkzeugausgaben oder Eingabefelder brauchst.
- ✓Wenn du AI Elements in ein Projekt einfügen willst, das bereits shadcn/ui nutzt.
Link zum Skill
https://github.com/trycompai/crm/blob/release/.agents/skills/ai-elements/SKILL.mdKopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.
So nutzt du ihn
Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.
Fertige Nachricht zum Einfügen
Für Claude Code, Codex oder Cursor: Führe den Befehl in deinem Projektordner aus, dann wird der Skill installiert.
Lade die SKILL.md herunter und lege sie in den Skills-Ordner deines Agenten.
Beispielanfrage an deine KI
“Kannst du mir helfen, einen Chat-Bildschirm mit Nachrichtenblasen und einem Eingabefeld in meine Next.js-App einzubauen?”
5 neue Skills pro Woche. 1 Minute Lesezeit.
So funktioniert es
Die KI installiert die Komponenten mit dem Paket-Runner des Projekts, fügt sie dem Projekt hinzu und verbindet sie mit der Chat-Oberfläche.
Technischer Inhalt (originale SKILL.md)
Originaltext des Autors, auf Englisch, direkt von GitHub.
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 yo
Häufige Fragen
Was braucht es vorher?
Der Skill nennt Node.js 18 oder neuer, ein Next.js-Projekt mit dem AI SDK und shadcn/ui.
Welchen Paket-Runner nutzt er?
Er nutzt den Runner, der zum Projekt passt, etwa npx, pnpm dlx oder bunx.
Empfiehlt er ein KI-Gateway?
Ja. Er schlägt vor, das AI Gateway zu nutzen und den API-Schlüssel in die lokale Umgebungsdatei einzutragen.
Details
Originalbeschreibung des Autors
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.
repo: trycompai/crm
Beliebtheit
- GitHub-Sterne
- 12k
- Platz im Ranking
- #11506
- Lizenz
- MIT
- Aktualisiert
- 1.11.2026
Kommentare
- …
Weitere Skills aus diesem Repository
ai-sdk
12kHilft deinem Agenten, KI-Funktionen mit dem Vercel AI SDK zu bauen, etwa Textgenerierung, Streaming, Werkzeugaufrufe und Agenten.
better-accessibility
12kHilft deinem Agenten, Oberflächen mit Tastatur und Screenreadern nutzbar zu machen, mit Fokus, Beschriftungen, ARIA und Formularen.
better-auth-best-practices
12kHilft deinem Agenten, Better Auth für Anmeldung, Sitzungen, OAuth und Plugins in einer TypeScript-App einzurichten, nach den dokumentierten Schritten.
better-colors
12kHilft deinem Agenten, Farben für eine Weboberfläche umzurechnen, auszuwählen und zu prüfen, einschließlich OKLCH-Paletten, Kontrast und Dunkelmodus.
Ähnliche Skills
angular-developer
280kHilft deinem Agenten bei Angular-Code und gibt Tipps zur Projektstruktur. Nützlich für neue Projekte, einzelne Code-Teile sowie Performance und Barrierefreiheit.
frontend-a11y
280kHilft deinem Agenten, Weboberflächen für alle zugänglich zu machen. Sorgt dafür, dass Websites und Apps gut mit Screenreadern und Tastaturnavigation funktionieren.
frontend-patterns
280kLässt deinen Agenten moderne Muster in der Frontend-Entwicklung anwenden. Optimiert Performance, verwaltet State und folgt Best Practices für React und Next.js.