본문으로 건너뛰기
Skillpedia
웹사이트 및 UI (프런트엔드)12k · #11506

ai-elements

하는 일

Next.js 프로젝트에 shadcn/ui 기반 AI 채팅 컴포넌트를 추가하도록 AI 에이전트를 안내합니다. 챗봇이나 AI 어시스턴트 화면을 만드는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓Next.js 앱에서 챗봇이나 AI 어시스턴트 화면을 만들고 싶을 때.
  • ✓채팅 메시지, 도구 출력, 프롬프트 입력을 위한 기성 컴포넌트가 필요할 때.
  • ✓이미 shadcn/ui를 쓰는 프로젝트에 AI Elements를 추가하고 싶을 때.

스킬 링크

https://github.com/trycompai/crm/blob/release/.agents/skills/ai-elements/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/trycompai/crm/blob/release/.agents/skills/ai-elements/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“Next.js 앱에 메시지 말풍선과 프롬프트 상자가 있는 채팅 화면을 추가하도록 도와줄 수 있나요?”

매주 새 스킬 5개. 읽는 데 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, or bunx --bun ai-elements@latest — based on the project's packageManager. Examples below use npx ai-elements@latest but 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_KEY to your env.local so 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 키를 로컬 환경 파일에 추가하라고 조언합니다.

상세 정보

작성자의 원본 설명

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
업데이트
2026. 11. 1.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬