ai-elements
Create new AI chat interface components for the ai-elements library following established composable patterns, shadcn/ui integration, and Vercel AI SDK conventions. Use when creating new components in packages/elements/src or when the user asks to add a new component to ai-elements.
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o ai-elements.zip https://jpskill.com/download/21006.zip && unzip -o ai-elements.zip && rm ai-elements.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/21006.zip -OutFile "$d\ai-elements.zip"; Expand-Archive "$d\ai-elements.zip" -DestinationPath $d -Force; ri "$d\ai-elements.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
ai-elements.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
ai-elementsフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 129
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
AI Elements
AI Elements は、AI ネイティブアプリケーションをより迅速に構築できるように、shadcn/ui の上に構築されたコンポーネントライブラリおよびカスタムレジストリです。会話やメッセージなどの事前構築済みコンポーネントを提供しています。
AI Elements のインストールは簡単で、いくつかの方法で行うことができます。最速のセットアップには専用の CLI コマンドを使用できますし、すでに shadcn のワークフローを採用している場合は、標準の shadcn/ui CLI を介して統合することも可能です。
クイックスタート
AI Elements のコンポーネントを使用して達成できることの基本的な例をいくつかご紹介します。
前提条件
AI Elements をインストールする前に、お使いの環境が以下の要件を満たしていることを確認してください。
- Node.js バージョン 18 以降
- AI SDK がインストールされた Next.js プロジェクト
- プロジェクトに shadcn/ui がインストールされていること。インストールされていない場合でも、いずれかのインストールコマンドを実行すると自動的にインストールされます。
- また、AI Gateway の使用を強くお勧めします。
AI_GATEWAY_API_KEYをenv.localに追加することで、すべてのプロバイダーから API キーを使用する必要がなくなります。AI Gateway は毎月 5 ドルの使用量も提供するため、モデルを試すことができます。API キーはこちらで取得できます。
コンポーネントのインストール
AI Elements コンポーネントは、AI Elements CLI または shadcn/ui CLI のいずれかを使用してインストールできます。どちらも同じ結果、つまり選択したコンポーネントのコードと必要な依存関係をプロジェクトに追加します。
CLI はコンポーネントのコードをダウンロードし、プロジェクトのディレクトリ(通常は components フォルダー内)に統合します。デフォルトでは、AI Elements コンポーネントは @/components/ai-elements/ ディレクトリ(または shadcn コンポーネント設定で構成したフォルダー)に追加されます。
コマンドの実行後、ファイルが追加されたことを示す確認メッセージがターミナルに表示されます。その後、コードでコンポーネントを使用できます。
使用方法
AI Elements コンポーネントがインストールされると、他の React コンポーネントと同様に、アプリケーションでインポートして使用できます。コンポーネントはコードベースの一部として(ライブラリに隠されることなく)追加されるため、非常に自然な使用感です。
例
AI Elements コンポーネントをインストールすると、他の React コンポーネントと同様にアプリケーションで使用できます。例:
"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;
上記の例では、AI Elements ディレクトリから Message コンポーネントをインポートし、JSX に含めています。次に、MessageContent および MessageResponse サブコンポーネントでコンポーネントを構成しています。コンポーネントのコードはプロジェクト内に存在するため、自分で書いた場合と同様にスタイル設定や構成を行うことができます。コンポーネントファイルを開いて動作を確認したり、カスタム変更を加えたりすることも可能です。
拡張性
すべての AI Elements コンポーネントは、可能な限り多くのプリミティブ属性を受け入れます。たとえば、Message コンポーネントは HTMLAttributes<HTMLDivElement> を拡張しているため、div がサポートする任意の props を渡すことができます。これにより、独自のスタイルや機能でコンポーネントを簡単に拡張できます。
カスタマイズ
インストール後、追加のセットアップは不要です。コンポーネントのスタイル(Tailwind CSS クラス)とスクリプトはすでに統合されています。すぐにアプリでコンポーネントとの対話を開始できます。
たとえば、Message の角丸を削除したい場合は、components/ai-elements/message.tsx に移動して、次のように rounded-lg を削除できます。
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>
);
トラブルシューティング
コンポーネントにスタイルが適用されないのはなぜですか?
プロジェクトが Tailwind 4 の shadcn/ui 用に正しく構成されていることを確認してください。これは、Tailwind をインポートし、shadcn/ui のベーススタイルを含む globals.css ファイルがあることを意味します。
AI Elements CLI を実行しましたが、プロジェクトに何も追加されませんでした
以下を再確認してください。
- 現在の作業ディレクトリがプロジェクトのルート(
package.jsonがある場所)であること。 components.jsonファイル(shadcn スタイルの設定を使用している場合)が正しく設定されていること。- AI Elements CLI の最新バージョンを使用していること:
npx ai-elements@latest
すべてがうまくいかない場合は、お気軽に GitHub で issue を開いてください。
テーマ切り替えが機能しません — アプリがライトモードのままです
アプリが shadcn/ui および AI Elements が期待するのと同じ data-theme システムを使用していることを確認してください。デフォルトの実装では、<html> 要素の data-theme 属性を切り替えます。tailwind.config.js がそれに応じて class または data- セレクターを使用していることを確認してください。
コンポーネントのインポートが「module not found」で失敗します
(原文がここで切り詰められています)
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
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.
Quick Start
Here are some basic examples of what you can achieve using components from AI Elements.
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 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.jsonlives). - 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
- Verify your config file syntax is valid JSON.
- Check that the file path is correct for your AI tool.
- Restart your coding assistant after making changes.
- 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.
同梱ファイル
※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。
- 📄 SKILL.md (7,112 bytes)
- 📎 references/agent.md (4,235 bytes)
- 📎 references/artifact.md (3,017 bytes)
- 📎 references/attachments.md (5,760 bytes)
- 📎 references/audio-player.md (5,346 bytes)
- 📎 references/canvas.md (1,175 bytes)
- 📎 references/chain-of-thought.md (3,410 bytes)
- 📎 references/checkpoint.md (5,543 bytes)
- 📎 references/code-block.md (5,538 bytes)
- 📎 references/commit.md (5,959 bytes)
- 📎 references/confirmation.md (8,422 bytes)
- 📎 references/connection.md (1,165 bytes)
- 📎 references/context.md (5,747 bytes)
- 📎 references/controls.md (971 bytes)
- 📎 references/conversation.md (7,447 bytes)
- 📎 references/edge.md (2,121 bytes)
- 📎 references/environment-variables.md (3,751 bytes)
- 📎 references/file-tree.md (2,027 bytes)
- 📎 references/image.md (4,074 bytes)
- 📎 references/inline-citation.md (11,089 bytes)
- 📎 references/jsx-preview.md (3,319 bytes)
- 📎 references/message.md (10,794 bytes)
- 📎 references/mic-selector.md (7,875 bytes)
- 📎 references/model-selector.md (4,378 bytes)
- 📎 references/node.md (2,870 bytes)
- 📎 references/open-in-chat.md (2,764 bytes)
- 📎 references/package-info.md (3,241 bytes)
- 📎 references/panel.md (1,040 bytes)
- 📎 references/persona.md (4,816 bytes)
- 📎 references/plan.md (3,271 bytes)
- 📎 references/prompt-input.md (19,781 bytes)
- 📎 references/queue.md (5,481 bytes)
- 📎 references/reasoning.md (7,932 bytes)
- 📎 references/sandbox.md (4,356 bytes)
- 📎 references/schema-display.md (2,534 bytes)
- 📎 references/shimmer.md (1,688 bytes)
- 📎 references/snippet.md (2,244 bytes)
- 📎 references/sources.md (6,350 bytes)
- 📎 references/speech-input.md (6,636 bytes)
- 📎 references/stack-trace.md (8,108 bytes)
- 📎 references/suggestion.md (3,674 bytes)
- 📎 references/task.md (6,900 bytes)
- 📎 references/terminal.md (3,132 bytes)
- 📎 references/test-results.md (5,111 bytes)
- 📎 references/tool.md (8,669 bytes)
- 📎 references/toolbar.md (983 bytes)
- 📎 references/transcription.md (5,011 bytes)
- 📎 references/voice-selector.md (10,565 bytes)
- 📎 references/web-preview.md (6,228 bytes)
- 📎 scripts/agent.tsx (1,626 bytes)
- 📎 scripts/artifact.tsx (2,968 bytes)
- 📎 scripts/attachments-inline.tsx (3,598 bytes)
- 📎 scripts/attachments-list.tsx (2,281 bytes)
- 📎 scripts/attachments.tsx (2,035 bytes)
- 📎 scripts/audio-player-remote.tsx (1,064 bytes)
- 📎 scripts/audio-player.tsx (1,859 bytes)
- 📎 scripts/chain-of-thought.tsx (141,884 bytes)
- 📎 scripts/checkpoint.tsx (2,890 bytes)
- 📎 scripts/code-block-dark.tsx (1,039 bytes)
- 📎 scripts/code-block.tsx (3,021 bytes)
- 📎 scripts/commit.tsx (2,171 bytes)
- 📎 scripts/confirmation-accepted.tsx (1,179 bytes)
- 📎 scripts/confirmation-rejected.tsx (1,175 bytes)
- 📎 scripts/confirmation-request.tsx (1,718 bytes)
- 📎 scripts/confirmation.tsx (1,707 bytes)
- 📎 scripts/context.tsx (1,005 bytes)
- 📎 scripts/conversation.tsx (4,244 bytes)
- 📎 scripts/environment-variables.tsx (1,735 bytes)
- 📎 scripts/file-tree-basic.tsx (380 bytes)
- 📎 scripts/file-tree-expanded.tsx (609 bytes)
- 📎 scripts/file-tree-selection.tsx (619 bytes)
- 📎 scripts/file-tree.tsx (1,527 bytes)
- 📎 scripts/image.tsx (139,751 bytes)
- 📎 scripts/inline-citation.tsx (3,315 bytes)
- 📎 scripts/jsx-preview.tsx (3,325 bytes)
- 📎 scripts/message.tsx (10,297 bytes)
- 📎 scripts/mic-selector.tsx (1,236 bytes)
- 📎 scripts/model-selector.tsx (8,682 bytes)
- 📎 scripts/open-in-chat.tsx (704 bytes)
- 📎 scripts/package-info.tsx (1,345 bytes)
- 📎 scripts/persona-command.tsx (2,540 bytes)
- 📎 scripts/persona-glint.tsx (2,538 bytes)
- 📎 scripts/persona-halo.tsx (2,537 bytes)
- 📎 scripts/persona-mana.tsx (2,537 bytes)
- 📎 scripts/persona-obsidian.tsx (2,541 bytes)
- 📎 scripts/persona-opal.tsx (2,575 bytes)
- 📎 scripts/plan.tsx (1,988 bytes)
- 📎 scripts/prompt-input-cursor.tsx (15,546 bytes)
- 📎 scripts/prompt-input-tooltip.tsx (1,108 bytes)
- 📎 scripts/prompt-input.tsx (7,463 bytes)
- 📎 scripts/queue-prompt-input.tsx (10,744 bytes)
- 📎 scripts/queue.tsx (8,196 bytes)
- 📎 scripts/reasoning.tsx (2,264 bytes)
- 📎 scripts/sandbox.tsx (5,505 bytes)
- 📎 scripts/schema-display-basic.tsx (221 bytes)
- 📎 scripts/schema-display-body.tsx (487 bytes)
- 📎 scripts/schema-display-nested.tsx (470 bytes)
- 📎 scripts/schema-display-params.tsx (374 bytes)
- 📎 scripts/schema-display.tsx (2,764 bytes)
- 📎 scripts/shimmer-duration.tsx (934 bytes)
- 📎 scripts/shimmer-elements.tsx (1,160 bytes)
- 📎 scripts/shimmer.tsx (443 bytes)
- 📎 scripts/snippet-plain.tsx (362 bytes)
- 📎 scripts/snippet.tsx (589 bytes)
- 📎 scripts/sources-custom.tsx (1,035 bytes)
- 📎 scripts/sources.tsx (752 bytes)
- 📎 scripts/speech-input.tsx (2,342 bytes)
- 📎 scripts/stack-trace-collapsed.tsx (1,097 bytes)
- 📎 scripts/stack-trace-no-internal.tsx (1,231 bytes)
- 📎 scripts/stack-trace.tsx (1,991 bytes)
- 📎 scripts/suggestion-input.tsx (4,539 bytes)
- 📎 scripts/suggestion.tsx (802 bytes)
- 📎 scripts/task.tsx (1,508 bytes)
- 📎 scripts/terminal-basic.tsx (169 bytes)
- 📎 scripts/terminal-clear.tsx (523 bytes)
- 📎 scripts/terminal-streaming.tsx (1,007 bytes)
- 📎 scripts/terminal.tsx (2,385 bytes)
- 📎 scripts/test-results-basic.tsx (464 bytes)
- 📎 scripts/test-results-errors.tsx (1,306 bytes)
- 📎 scripts/test-results-suites.tsx (901 bytes)
- 📎 scripts/test-results.tsx (2,718 bytes)
- 📎 scripts/tool-input-available.tsx (738 bytes)
- 📎 scripts/tool-input-streaming.tsx (683 bytes)
- 📎 scripts/tool-output-available.tsx (1,789 bytes)
- 📎 scripts/tool-output-error.tsx (1,077 bytes)
- 📎 scripts/tool.tsx (6,865 bytes)
- 📎 scripts/transcription.tsx (4,980 bytes)
- 📎 scripts/voice-selector.tsx (7,240 bytes)
- 📎 scripts/web-preview.tsx (2,859 bytes)