本文へ移動
cccskills
無料GitHub で公開

ai-elements

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.

インストール方法を見る

含まれるファイル(130)

  • SKILL.md8.3 KB
  • agents/openai.yaml273 B
  • references/agent.md5.7 KB
  • references/artifact.md4.9 KB
  • references/attachments.md7.8 KB
  • references/audio-player.md8.1 KB
  • references/canvas.md1.7 KB
  • references/chain-of-thought.md5.1 KB
  • references/checkpoint.md6.7 KB
  • references/code-block.md7.5 KB
  • references/commit.md9.4 KB
  • references/confirmation.md11.1 KB
  • references/connection.md1.6 KB
  • references/context.md7.9 KB
  • references/controls.md1.6 KB
  • references/conversation.md9.2 KB
  • references/edge.md2.9 KB
  • references/environment-variables.md6.0 KB
  • references/file-tree.md2.9 KB
  • references/image.md4.5 KB
  • references/inline-citation.md13.4 KB
  • references/jsx-preview.md4.4 KB
  • references/message.md12.9 KB
  • references/mic-selector.md10.9 KB
  • references/model-selector.md7.5 KB
  • references/node.md4.7 KB
  • references/open-in-chat.md4.2 KB
  • references/package-info.md5.2 KB
  • references/panel.md1.5 KB
  • references/persona.md6.2 KB
  • references/plan.md5.4 KB
  • references/prompt-input.md27.9 KB
  • references/queue.md8.2 KB
  • references/reasoning.md9.5 KB
  • references/sandbox.md6.1 KB
  • references/schema-display.md3.0 KB
  • references/shimmer.md2.3 KB
  • references/snippet.md3.7 KB
  • references/sources.md7.1 KB
  • references/speech-input.md7.6 KB
  • references/stack-trace.md12.3 KB
  • references/suggestion.md4.4 KB
  • references/task.md7.9 KB
  • references/terminal.md4.6 KB
  • references/test-results.md8.0 KB
  • references/tool.md10.1 KB
  • references/toolbar.md1.6 KB
  • references/transcription.md5.9 KB
  • references/voice-selector.md16.6 KB
  • references/web-preview.md7.7 KB
  • scripts/agent.tsx1.9 KB
  • scripts/artifact.tsx3.1 KB
  • scripts/attachments-inline.tsx3.7 KB
  • scripts/attachments-list.tsx2.5 KB
  • scripts/attachments.tsx2.2 KB
  • scripts/audio-player-remote.tsx1.0 KB
  • scripts/audio-player.tsx2.1 KB
  • scripts/chain-of-thought.tsx138.8 KB
  • scripts/checkpoint.tsx2.9 KB
  • scripts/code-block-dark.tsx1.0 KB
  • scripts/code-block.tsx3.2 KB
  • scripts/commit.tsx2.1 KB
  • scripts/confirmation-accepted.tsx1.4 KB
  • scripts/confirmation-rejected.tsx1.4 KB
  • scripts/confirmation-request.tsx1.7 KB
  • scripts/confirmation.tsx2.0 KB
  • scripts/context.tsx1005 B
  • scripts/conversation.tsx4.4 KB
  • scripts/environment-variables.tsx1.9 KB
  • scripts/file-tree-basic.tsx694 B
  • scripts/file-tree-expanded.tsx926 B
  • scripts/file-tree-selection.tsx937 B
  • scripts/file-tree.tsx1.8 KB
  • scripts/image.tsx136.5 KB
  • scripts/inline-citation.tsx3.5 KB
  • scripts/jsx-preview.tsx3.5 KB
  • scripts/message.tsx10.0 KB
  • scripts/mic-selector.tsx1.5 KB
  • scripts/model-selector.tsx8.8 KB
  • scripts/open-in-chat.tsx704 B
  • scripts/package-info.tsx1.6 KB
  • scripts/persona-command.tsx2.7 KB
  • scripts/persona-glint.tsx2.7 KB
  • scripts/persona-halo.tsx2.7 KB
  • scripts/persona-mana.tsx2.7 KB
  • scripts/persona-obsidian.tsx2.7 KB
  • scripts/persona-opal.tsx2.8 KB
  • scripts/plan.tsx2.2 KB
  • scripts/prompt-input-cursor.tsx15.0 KB
  • scripts/prompt-input-tooltip.tsx1.4 KB
  • scripts/prompt-input.tsx7.5 KB
  • scripts/queue-prompt-input.tsx10.5 KB
  • scripts/queue.tsx8.0 KB
  • scripts/reasoning.tsx2.5 KB
  • scripts/sandbox.tsx5.5 KB
  • scripts/schema-display-basic.tsx541 B
  • scripts/schema-display-body.tsx487 B
  • scripts/schema-display-nested.tsx470 B
  • scripts/schema-display-params.tsx374 B
  • scripts/schema-display.tsx2.7 KB
  • scripts/shimmer-duration.tsx1.2 KB
  • scripts/shimmer-elements.tsx1.4 KB
  • scripts/shimmer.tsx443 B
  • scripts/snippet-plain.tsx362 B
  • scripts/snippet.tsx589 B
  • scripts/sources-custom.tsx1.3 KB
  • scripts/sources.tsx1.0 KB
  • scripts/speech-input.tsx2.6 KB
  • scripts/stack-trace-collapsed.tsx1.1 KB
  • scripts/stack-trace-no-internal.tsx1.2 KB
  • scripts/stack-trace.tsx2.2 KB
  • scripts/suggestion-input.tsx4.7 KB
  • scripts/suggestion.tsx1.1 KB
  • scripts/task.tsx1.5 KB
  • scripts/terminal-basic.tsx169 B
  • scripts/terminal-clear.tsx523 B
  • scripts/terminal-streaming.tsx1007 B
  • scripts/terminal.tsx2.6 KB
  • scripts/test-results-basic.tsx464 B
  • scripts/test-results-errors.tsx1.3 KB
  • scripts/test-results-suites.tsx901 B
  • scripts/test-results.tsx2.7 KB
  • scripts/tool-input-available.tsx738 B
  • scripts/tool-input-streaming.tsx683 B
  • scripts/tool-output-available.tsx2.0 KB
  • scripts/tool-output-error.tsx1.4 KB
  • scripts/tool.tsx6.9 KB
  • scripts/transcription.tsx5.1 KB
  • scripts/voice-selector.tsx7.3 KB
  • scripts/web-preview.tsx3.0 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

<!-- Adapted for codexhost from ZCode 872ad960de7ec172591f7e1952f7849229f94521. See ../NOTICE.md for provenance and licenses. -->

codexhost integration

Use these references when the task actually involves AI chat components. Inspect the owning package and its existing UI before installing anything. The examples are copied reference snippets, not build inputs or already-installed product dependencies. Apply root package exports and Renderer browser-safety rules.

The upstream Next.js, AI SDK, shadcn and gateway setup guidance is conditional on a project using that stack. codexhost's existing Renderer extension does not become a Next.js app by using this skill. Select commands from the target package's scripts and package manager, reuse existing components where suitable, and add dependencies only when needed for the authorized implementation.

<!-- Derived from vercel/ai-elements (skills/ai-elements/SKILL.md). Copyright 2023 Vercel, Inc. Licensed under Apache-2.0. Modified by ZCode: local integration, formatting and adaptations. See ../NOTICE.md for retained license and provenance information. -->

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 you'd like to remove the rounding on Message, you can go to components/ai-elements/message.tsx and remove rounded-lg as follows:

export const MessageContent = ({ children, className, ...props }: MessageContentProps) => (
  <div
    className={cn(
      "flex flex-col gap-2 text-sm text-foreground",
      "group-[.is-user]:bg-primary group-[.is-user]:text-primary-foreground group-[.is-user]:px-4 group-[.is-user]:py-3",
      className,
    )}
    {...props}
  >
    <div className="is-user:dark">{children}</div>
  </div>
);

Troubleshooting

Why are my components not styled?

Make sure your project is configured correctly for shadcn/ui in Tailwind 4 - this means having a globals.css file that imports Tailwind and includes the shadcn/ui base styles.

I ran the AI Elements CLI but nothing was added to my project

Double-check that:

  • Your current working directory is the root of your project (where package.json lives).
  • Your components.json file (if using shadcn-style config) is set up correctly.
  • You’re using the latest version of the AI Elements CLI:
npx ai-elements@latest

If all else fails, feel free to open an issue on GitHub.

Theme switching doesn’t work — my app stays in light mode

Ensure your app is using the same data-theme system that shadcn/ui and AI Elements expect. The default implementation toggles a data-theme attribute on the <html> element. Make sure your tailwind.config.js is using class or data- selectors accordingly.

The component imports fail with “module not found”

Check the file exists. If it does, make sure your tsconfig.json has a proper paths alias for @/ i.e.

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@/*": ["./*"]
    }
  }
}

My AI coding assistant can't access AI Elements components

  1. Verify your config file syntax is valid JSON.
  2. Check that the file path is correct for your AI tool.
  3. Restart your coding assistant after making changes.
  4. Ensure you have a stable internet connection.

Still stuck?

If none of these answers help, open an issue on GitHub and someone will be happy to assist.

Available Components

See the references/ folder for detailed documentation on each component. Paths beginning with scripts/ in those references are examples relative to this skill directory, not repository-root scripts. They are component examples, not installed application features.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.

日本語の概要は準備中です。原文の説明を表示しています。

BytePioneer-AI/codex-host2,8142026年10月12日 更新

Apply codexhost package and native ownership rules when changing production code or dependency directions. Inspect public contracts and run the existing boundary check; skip documentation-only work.

日本語の概要は準備中です。原文の説明を表示しています。

BytePioneer-AI/codex-host2,8142026年10月12日 更新

为 codexhost 新增 Harness 插件,或规划、审查、补全现有 Harness Adapter。按当前公共契约实现原生能力,区分插件后端、预装发行和 Desktop 产品接入;不用于单纯添加 Model、Provider 或账号。

日本語の概要は準備中です。原文の説明を表示しています。

BytePioneer-AI/codex-host2,8142026年10月12日 更新

手动增量分诊 codexhost Issue 与 PR,评估 PR 价值和实现克制,生成只读本地看板与回复草稿。

日本語の概要は準備中です。原文の説明を表示しています。

BytePioneer-AI/codex-host2,8142026年10月12日 更新

发布 codexhost 正式版、预览版,编写或确认 Release Notes,检查发布 CI,暂停、恢复或排查发布。支持正常正式发布,以及 npm latest + GitHub Prerelease、不给现有用户更新提示的预览发行。不用于普通代码提交或 Harness CLI 更新。

日本語の概要は準備中です。原文の説明を表示しています。

BytePioneer-AI/codex-host2,8142026年10月12日 更新

Diagnose whether a Codex Desktop update changed codexhost Composer/CDP bindings, private Renderer DOM or React state, Host bridges, routing, the Codex usage submission gate, or injected UI. Use after an installed Codex update or when compatibility regresses and the affected surface is unknown.

日本語の概要は準備中です。原文の説明を表示しています。

BytePioneer-AI/codex-host2,8142026年10月12日 更新

BytePioneer-AI のスキルをすべて見る

このスキルの問題を報告する