Saltar al contenido
Skillpedia
Sitios e interfaces (frontend)12 mil · #11506

ai-elements

Qué hace

Guía a la IA para añadir componentes de chat con IA, basados en shadcn/ui, a un proyecto de Next.js. Está pensada para desarrolladores que crean chatbots o pantallas de asistentes de IA.

Cuándo usarla

  • ✓Cuando quieres crear un chatbot o una pantalla de asistente de IA en una aplicación de Next.js.
  • ✓Cuando necesitas componentes ya hechos para mensajes de chat, resultados de herramientas o campos de instrucciones.
  • ✓Cuando quieres añadir AI Elements a un proyecto que ya usa shadcn/ui.

Link de la skill

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

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/trycompai/crm/blob/release/.agents/skills/ai-elements/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“¿Puedes ayudarme a añadir una pantalla de chat con burbujas de mensajes y un cuadro de instrucciones a mi aplicación de Next.js?”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

La IA instala los componentes con el ejecutor de paquetes del proyecto, los añade al proyecto y los conecta a la interfaz de chat.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de 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

Preguntas frecuentes

¿Qué necesita primero?

La skill indica Node.js 18 o superior, un proyecto de Next.js con el AI SDK y shadcn/ui.

¿Qué ejecutor de paquetes usa?

Usa el que coincide con el proyecto, como npx, pnpm dlx o bunx.

¿Recomienda una pasarela de IA?

Sí. Sugiere usar AI Gateway y añadir su clave de API al archivo de entorno local.

Detalles

Descripción original del autor

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

Popularidad

Estrellas en GitHub
12 mil
Posición en el ranking
#11506
Licencia
MIT
Actualizada
1/11/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas