ai-elements
Fungsinya
Skill ini memandu AI untuk menambahkan komponen chat AI, yang dibangun di atas shadcn/ui, ke proyek Next.js. Skill ini untuk pengembang yang membangun chatbot atau layar asisten AI.
Kapan dipakai
- ✓Saat Anda ingin membangun layar chatbot atau asisten AI di aplikasi Next.js.
- ✓Saat Anda memerlukan komponen siap pakai untuk pesan chat, output alat, atau input prompt.
- ✓Saat Anda ingin menambahkan AI Elements ke proyek yang sudah memakai shadcn/ui.
Link skill
https://github.com/trycompai/crm/blob/release/.agents/skills/ai-elements/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
“Bisakah Anda membantu saya menambahkan layar chat dengan gelembung pesan dan kotak prompt ke aplikasi Next.js saya?”
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
AI memasang komponen dengan package runner proyek, menambahkannya ke proyek, dan menghubungkannya ke antarmuka chat.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
Pertanyaan umum
Apa yang dibutuhkan lebih dulu?
Skill ini mencantumkan Node.js 18 atau yang lebih baru, proyek Next.js dengan AI SDK, dan shadcn/ui.
Package runner apa yang dipakai?
Skill ini memakai runner yang sesuai dengan proyek, seperti npx, pnpm dlx, atau bunx.
Apakah skill ini merekomendasikan AI gateway?
Ya, skill ini menyarankan untuk memakai AI Gateway dan menambahkan API key-nya ke berkas environment lokal.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 12k
- Peringkat
- #11506
- Lisensi
- MIT
- Diperbarui
- 1/11/2026
Komentar
- …
Skill lain dari repositori ini
ai-sdk
12kMembantu agent Anda membangun fitur AI dengan Vercel AI SDK, termasuk pembuatan teks, streaming, pemanggilan alat, dan agent.
better-accessibility
12kMembantu agent Anda membuat antarmuka dapat digunakan dengan keyboard dan pembaca layar, mencakup fokus, label, ARIA, dan formulir.
better-auth-best-practices
12kMembantu agent Anda menyiapkan Better Auth untuk login, sesi, OAuth, dan plugin di aplikasi TypeScript, dengan mengikuti langkah yang didokumentasikan.
better-colors
12kMembantu agent Anda mengonversi, memilih, dan memeriksa warna untuk antarmuka web, termasuk palet OKLCH, kontras, dan mode gelap.
Skill serupa
angular-developer
280kMembantu agent Anda membuat kode Angular dan memberi saran struktur proyek. Berguna saat memulai proyek baru, membuat komponen, atau meningkatkan performa.
frontend-a11y
280kMembantu agent Anda membuat antarmuka web dapat diakses semua orang. Memastikan website dan aplikasi berfungsi baik dengan screen reader dan navigasi keyboard.
frontend-patterns
280kMembuat agent Anda menerapkan pola modern dalam frontend. Mengoptimalkan performa, mengelola state, dan mengikuti praktik terbaik React dan Next.js.