ai-elements
यह क्या करती है
यह AI चैट कॉम्पोनेंट जोड़ने के चरण समझाती है, जो shadcn/ui पर बने हैं और Next.js प्रोजेक्ट में जोड़े जाते हैं। यह चैटबॉट या AI असिस्टेंट स्क्रीन बनाने वाले डेवलपर्स के लिए है।
कब इस्तेमाल करें
- ✓जब आप Next.js ऐप में चैटबॉट या AI असिस्टेंट की स्क्रीन बनाना चाहते हैं।
- ✓जब आपको चैट संदेशों, टूल आउटपुट या प्रॉम्प्ट इनपुट के लिए तैयार कॉम्पोनेंट चाहिए।
- ✓जब आप AI Elements को ऐसे प्रोजेक्ट में जोड़ना चाहते हैं जो पहले से shadcn/ui इस्तेमाल करता है।
Skill का लिंक
https://github.com/trycompai/crm/blob/release/.agents/skills/ai-elements/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“क्या आप मेरे Next.js ऐप में संदेश बबल और प्रॉम्प्ट बॉक्स वाली चैट स्क्रीन जोड़ने में मदद कर सकते हैं?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
AI प्रोजेक्ट के पैकेज रनर से कॉम्पोनेंट इंस्टॉल करता है, उन्हें प्रोजेक्ट में जोड़ता है और चैट इंटरफ़ेस में जोड़ देता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे 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
अक्सर पूछे जाने वाले सवाल
इसके लिए पहले क्या चाहिए?
स्किल Node.js 18 या उससे नया, AI SDK वाला Next.js प्रोजेक्ट और shadcn/ui माँगती है।
यह कौन-सा पैकेज रनर इस्तेमाल करती है?
यह प्रोजेक्ट से मेल खाने वाला रनर इस्तेमाल करती है, जैसे npx, pnpm dlx या bunx।
क्या यह AI गेटवे की सलाह देती है?
हाँ, यह AI Gateway इस्तेमाल करने और उसकी API key को लोकल एनवायरनमेंट फ़ाइल में जोड़ने का सुझाव देती है।
जानकारी
लेखक का मूल विवरण
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
लोकप्रियता
- GitHub स्टार
- 12k
- रैंकिंग में स्थान
- #11506
- लाइसेंस
- MIT
- अपडेट की गई
- 1/11/2026
कमेंट
- …
इस repository की और skills
ai-sdk
12kयह आपके एजेंट को Vercel AI SDK से AI फ़ीचर बनाने में मदद करती है, जिसमें टेक्स्ट जनरेशन, स्ट्रीमिंग, टूल कॉलिंग और एजेंट शामिल हैं।
better-accessibility
12kयह आपके एजेंट को इंटरफ़ेस को कीबोर्ड और स्क्रीन रीडर के लिए उपयोगी बनाने में मदद करती है, जिसमें फ़ोकस, लेबल, ARIA और फ़ॉर्म शामिल हैं।
better-auth-best-practices
12kयह आपके एजेंट को TypeScript ऐप में लॉगिन, सेशन, OAuth और प्लगइन के लिए Better Auth सेट करने में मदद करती है, उसके दस्तावेज़ी चरणों के अनुसार।
better-colors
12kयह आपके एजेंट को वेब इंटरफ़ेस के लिए रंग बदलने, चुनने और जाँचने में मदद करती है, जिसमें OKLCH पैलेट, कॉन्ट्रास्ट और डार्क मोड शामिल हैं।
मिलती-जुलती skills
angular-developer
280kआपके एजेंट को Angular code बनाने और प्रोजेक्ट स्ट्रक्चर पर सलाह देने में मदद करता है। नए प्रोजेक्ट शुरू करने, code के हिस्से बनाने, या performance और accessibility सुधारने में उपयोगी है।
frontend-a11y
280kआपके एजेंट को web interfaces को सबके लिए accessible बनाने में मदद करता है। यह सुनिश्चित करता है कि websites और apps screen readers और keyboard navigation के साथ अच्छे से काम करें।
frontend-patterns
280kआपके एजेंट को React और Next.js में frontend development के modern patterns लागू करने में मदद करता है। यह performance optimize करता है, state manage करता है और best practices फॉलो करवाता है।