ai-sdk-elements
AI SDK Elementsは、Reactコンポーネントを使ってチャットUIやAIの思考過程表示、ツール実行確認など、AIを活用したインターフェースを効率的に構築するSkill。
📜 元の英語説明(参考)
Build AI chat interfaces with AI SDK Elements - React components for chatbots. Use when: implementing chat UIs, adding AI reasoning displays, tool confirmations, message components, or any AI-native interface. Built on shadcn/ui.
🇯🇵 日本人クリエイター向け解説
AI SDK Elementsは、Reactコンポーネントを使ってチャットUIやAIの思考過程表示、ツール実行確認など、AIを活用したインターフェースを効率的に構築するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o ai-sdk-elements.zip https://jpskill.com/download/8664.zip && unzip -o ai-sdk-elements.zip && rm ai-sdk-elements.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/8664.zip -OutFile "$d\ai-sdk-elements.zip"; Expand-Archive "$d\ai-sdk-elements.zip" -DestinationPath $d -Force; ri "$d\ai-sdk-elements.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
ai-sdk-elements.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
ai-sdk-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
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
AI SDK Elements
概要
AI SDK Elements は、AI ネイティブアプリケーション向けに shadcn/ui をベースに構築された React コンポーネントライブラリです。Vercel の AI SDK エコシステムの一部です。
要件:
- React 19 (forwardRef パターンは不可)
- Tailwind CSS 4
- shadcn/ui の設定
ドキュメント: https://ai-sdk.dev/elements
クイックリファレンス
# すべてのコンポーネントをインストール
npx ai-elements@latest
# 特定のコンポーネントをインストール
npx ai-elements@latest add conversation
npx ai-elements@latest add message
npx ai-elements@latest add reasoning
# 代替手段 (shadcn CLI)
npx shadcn@latest add @ai-elements/conversation
コンポーネントは @/components/ai-elements/ にインストールされます。
コアコンポーネント
Conversation (チャットコンテナ)
自動で最下部までスクロールするメインのラッパーです。
import {
Conversation,
ConversationContent,
ConversationEmptyState,
ConversationScrollButton,
} from '@/components/ai-elements/conversation';
<Conversation className="relative h-full">
<ConversationContent>
{messages.length === 0 ? (
<ConversationEmptyState
icon={<MessageSquareIcon />}
title="Start a conversation"
description="Ask me anything"
/>
) : (
messages.map((msg) => (
<Message key={msg.id} from={msg.role}>
<MessageContent>{msg.content}</MessageContent>
</Message>
))
)}
</ConversationContent>
<ConversationScrollButton />
</Conversation>
Message
個々のチャットメッセージの表示です。
import { Message, MessageContent } from '@/components/ai-elements/message';
<Message from="user">
<MessageContent>Hello, can you help me?</MessageContent>
</Message>
<Message from="assistant">
<MessageContent>{response}</MessageContent>
</Message>
Prompt Input
チャットのユーザー入力です。
import { PromptInput } from '@/components/ai-elements/prompt-input';
<PromptInput
value={input}
onChange={(e) => setInput(e.target.value)}
onSubmit={handleSubmit}
placeholder="Type a message..."
/>
AI 推論コンポーネント
Reasoning (折りたたみ可能な思考)
ストリーミング中に自動的に開き、完了すると折りたたまれます。
import {
Reasoning,
ReasoningTrigger,
ReasoningContent,
} from '@/components/ai-elements/reasoning';
<Reasoning isStreaming={isStreaming} className="w-full">
<ReasoningTrigger title="Thinking..." />
<ReasoningContent>{reasoningText}</ReasoningContent>
</Reasoning>
Chain of Thought
検索結果、画像、進捗状況を含む、視覚的なステップごとの推論です。
import { ChainOfThought } from '@/components/ai-elements/chain-of-thought';
<ChainOfThought>
<ChainOfThoughtStep>
<ChainOfThoughtIcon><SearchIcon /></ChainOfThoughtIcon>
<ChainOfThoughtContent>
Searching for profiles...
<ChainOfThoughtLinks>
<ChainOfThoughtLink href="https://x.com">x.com</ChainOfThoughtLink>
<ChainOfThoughtLink href="https://github.com">github.com</ChainOfThoughtLink>
</ChainOfThoughtLinks>
</ChainOfThoughtContent>
</ChainOfThoughtStep>
</ChainOfThought>
Plan & Task
エージェントの計画と個々のタスクを表示します。
import { Plan, Task } from '@/components/ai-elements/plan';
<Plan title="Implementation Plan">
<Task status="completed">Set up project structure</Task>
<Task status="in_progress">Implement core features</Task>
<Task status="pending">Write tests</Task>
</Plan>
インタラクティビティコンポーネント
Confirmation (ツールの承認)
ツールの実行承認ワークフローを管理します。
import {
Confirmation,
ConfirmationRequest,
ConfirmationAccepted,
ConfirmationRejected,
ConfirmationActions,
ConfirmationAction,
} from '@/components/ai-elements/confirmation';
<Confirmation approval={tool.approval} state={tool.state}>
<ConfirmationRequest>
This tool wants to delete: <code>{tool.input?.filePath}</code>
<br />Do you approve?
</ConfirmationRequest>
<ConfirmationAccepted>File deleted successfully</ConfirmationAccepted>
<ConfirmationRejected>Action cancelled</ConfirmationRejected>
<ConfirmationActions>
<ConfirmationAction
onClick={() => respondToConfirmationRequest({ approvalId, approved: false })}>
Reject
</ConfirmationAction>
<ConfirmationAction
onClick={() => respondToConfirmationRequest({ approvalId, approved: true })}>
Approve
</ConfirmationAction>
</ConfirmationActions>
</Confirmation>
Suggestion (クイックプロンプト)
クリック可能な提案の水平方向の行です。
import { Suggestions, Suggestion } from '@/components/ai-elements/suggestion';
const prompts = [
'How do I get started?',
'What can you help with?',
'Show me examples',
];
<Suggestions>
{prompts.map((prompt) => (
<Suggestion
key={prompt}
suggestion={prompt}
onClick={(text) => setInput(text)}
/>
))}
</Suggestions>
Tool
ツールの呼び出しと結果を表示します。
import { Tool, ToolContent, ToolResult } from '@/components/ai-elements/tool';
<Tool name="search_web">
<ToolContent>
Searching for: {tool.args.query}
</ToolContent>
<ToolResult>
{tool.result}
</ToolResult>
</Tool>
Checkpoint (復元ポイント)
会話履歴をマークして復元します。
import {
Checkpoint,
CheckpointIcon,
CheckpointTrigger,
} from '@/components/ai-elements/checkpoint';
<Checkpoint>
<CheckpointIcon />
<CheckpointTrigger onClick={() => restoreToCheckpoint(index)}>
Restore to this point
</CheckpointTrigger>
</Checkpoint>
引用コンポーネント
Sources
折りたたみ可能なソースの引用です。
import {
Sources,
SourcesTrigger,
SourcesContent,
Source,
} from '@/components/ai-elements/sources';
<Sources>
<SourcesTrigger count={3} />
<SourcesContent>
<Source href="https://docs.example.com/api" title="API Documentation" />
<Source href="https://example.com/guide" title="Getting Started Guide" />
<Source href="https://example.com/faq" title="FAQ" />
</SourcesContent>
</Sources>
Inline Citation
テキスト内の引用
(原文がここで切り詰められています)
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
AI SDK Elements
Overview
AI SDK Elements is a React component library built on shadcn/ui for AI-native applications. Part of Vercel's AI SDK ecosystem.
Requirements:
- React 19 (no forwardRef patterns)
- Tailwind CSS 4
- shadcn/ui configured
Docs: https://ai-sdk.dev/elements
Quick Reference
# Install all components
npx ai-elements@latest
# Install specific component
npx ai-elements@latest add conversation
npx ai-elements@latest add message
npx ai-elements@latest add reasoning
# Alternative (shadcn CLI)
npx shadcn@latest add @ai-elements/conversation
Components install to @/components/ai-elements/
Core Components
Conversation (Chat Container)
Main wrapper with auto-scroll to bottom.
import {
Conversation,
ConversationContent,
ConversationEmptyState,
ConversationScrollButton,
} from '@/components/ai-elements/conversation';
<Conversation className="relative h-full">
<ConversationContent>
{messages.length === 0 ? (
<ConversationEmptyState
icon={<MessageSquareIcon />}
title="Start a conversation"
description="Ask me anything"
/>
) : (
messages.map((msg) => (
<Message key={msg.id} from={msg.role}>
<MessageContent>{msg.content}</MessageContent>
</Message>
))
)}
</ConversationContent>
<ConversationScrollButton />
</Conversation>
Message
Individual chat message display.
import { Message, MessageContent } from '@/components/ai-elements/message';
<Message from="user">
<MessageContent>Hello, can you help me?</MessageContent>
</Message>
<Message from="assistant">
<MessageContent>{response}</MessageContent>
</Message>
Prompt Input
User input for chat.
import { PromptInput } from '@/components/ai-elements/prompt-input';
<PromptInput
value={input}
onChange={(e) => setInput(e.target.value)}
onSubmit={handleSubmit}
placeholder="Type a message..."
/>
AI Reasoning Components
Reasoning (Collapsible Thinking)
Auto-opens during streaming, collapses when done.
import {
Reasoning,
ReasoningTrigger,
ReasoningContent,
} from '@/components/ai-elements/reasoning';
<Reasoning isStreaming={isStreaming} className="w-full">
<ReasoningTrigger title="Thinking..." />
<ReasoningContent>{reasoningText}</ReasoningContent>
</Reasoning>
Chain of Thought
Visual step-by-step reasoning with search results, images, progress.
import { ChainOfThought } from '@/components/ai-elements/chain-of-thought';
<ChainOfThought>
<ChainOfThoughtStep>
<ChainOfThoughtIcon><SearchIcon /></ChainOfThoughtIcon>
<ChainOfThoughtContent>
Searching for profiles...
<ChainOfThoughtLinks>
<ChainOfThoughtLink href="https://x.com">x.com</ChainOfThoughtLink>
<ChainOfThoughtLink href="https://github.com">github.com</ChainOfThoughtLink>
</ChainOfThoughtLinks>
</ChainOfThoughtContent>
</ChainOfThoughtStep>
</ChainOfThought>
Plan & Task
Display agent plans and individual tasks.
import { Plan, Task } from '@/components/ai-elements/plan';
<Plan title="Implementation Plan">
<Task status="completed">Set up project structure</Task>
<Task status="in_progress">Implement core features</Task>
<Task status="pending">Write tests</Task>
</Plan>
Interactivity Components
Confirmation (Tool Approval)
Manage tool execution approval workflows.
import {
Confirmation,
ConfirmationRequest,
ConfirmationAccepted,
ConfirmationRejected,
ConfirmationActions,
ConfirmationAction,
} from '@/components/ai-elements/confirmation';
<Confirmation approval={tool.approval} state={tool.state}>
<ConfirmationRequest>
This tool wants to delete: <code>{tool.input?.filePath}</code>
<br />Do you approve?
</ConfirmationRequest>
<ConfirmationAccepted>File deleted successfully</ConfirmationAccepted>
<ConfirmationRejected>Action cancelled</ConfirmationRejected>
<ConfirmationActions>
<ConfirmationAction
onClick={() => respondToConfirmationRequest({ approvalId, approved: false })}>
Reject
</ConfirmationAction>
<ConfirmationAction
onClick={() => respondToConfirmationRequest({ approvalId, approved: true })}>
Approve
</ConfirmationAction>
</ConfirmationActions>
</Confirmation>
Suggestion (Quick Prompts)
Horizontal row of clickable suggestions.
import { Suggestions, Suggestion } from '@/components/ai-elements/suggestion';
const prompts = [
'How do I get started?',
'What can you help with?',
'Show me examples',
];
<Suggestions>
{prompts.map((prompt) => (
<Suggestion
key={prompt}
suggestion={prompt}
onClick={(text) => setInput(text)}
/>
))}
</Suggestions>
Tool
Display tool calls and results.
import { Tool, ToolContent, ToolResult } from '@/components/ai-elements/tool';
<Tool name="search_web">
<ToolContent>
Searching for: {tool.args.query}
</ToolContent>
<ToolResult>
{tool.result}
</ToolResult>
</Tool>
Checkpoint (Restore Points)
Mark and restore conversation history.
import {
Checkpoint,
CheckpointIcon,
CheckpointTrigger,
} from '@/components/ai-elements/checkpoint';
<Checkpoint>
<CheckpointIcon />
<CheckpointTrigger onClick={() => restoreToCheckpoint(index)}>
Restore to this point
</CheckpointTrigger>
</Checkpoint>
Citation Components
Sources
Collapsible source citations.
import {
Sources,
SourcesTrigger,
SourcesContent,
Source,
} from '@/components/ai-elements/sources';
<Sources>
<SourcesTrigger count={3} />
<SourcesContent>
<Source href="https://docs.example.com/api" title="API Documentation" />
<Source href="https://example.com/guide" title="Getting Started Guide" />
<Source href="https://example.com/faq" title="FAQ" />
</SourcesContent>
</Sources>
Inline Citation
Citations within text content.
import { InlineCitation } from '@/components/ai-elements/inline-citation';
<p>
According to the documentation
<InlineCitation href="https://docs.example.com" index={1} />
, you should...
</p>
Loading Components
Queue
Message queue/loading state.
import { Queue } from '@/components/ai-elements/queue';
<Queue>Processing your request...</Queue>
Shimmer
Skeleton loading placeholder.
import { Shimmer } from '@/components/ai-elements/shimmer';
{isLoading && <Shimmer className="h-20 w-full" />}
Utility Components
Model Selector
Switch between AI models.
import { ModelSelector } from '@/components/ai-elements/model-selector';
<ModelSelector
models={['gpt-4', 'claude-3', 'gemini-pro']}
selected={model}
onSelect={setModel}
/>
Context
Display context information.
import { Context } from '@/components/ai-elements/context';
<Context title="Current Context">
Working on: Project Alpha
Files: 3 selected
</Context>
Complete Chat Example
'use client';
import { useState } from 'react';
import { useChat } from 'ai/react';
import {
Conversation,
ConversationContent,
ConversationEmptyState,
ConversationScrollButton,
} from '@/components/ai-elements/conversation';
import { Message, MessageContent } from '@/components/ai-elements/message';
import { PromptInput } from '@/components/ai-elements/prompt-input';
import { Reasoning, ReasoningTrigger, ReasoningContent } from '@/components/ai-elements/reasoning';
import { Suggestions, Suggestion } from '@/components/ai-elements/suggestion';
import { Sources, SourcesTrigger, SourcesContent, Source } from '@/components/ai-elements/sources';
export function Chat() {
const { messages, input, setInput, handleSubmit, isLoading } = useChat();
const suggestions = [
'What can you help me with?',
'Tell me about AI SDK',
'How do I get started?',
];
return (
<div className="flex h-screen flex-col">
<Conversation className="flex-1">
<ConversationContent className="p-4">
{messages.length === 0 ? (
<>
<ConversationEmptyState
title="Welcome!"
description="Ask me anything to get started"
/>
<Suggestions className="mt-4">
{suggestions.map((s) => (
<Suggestion key={s} suggestion={s} onClick={setInput} />
))}
</Suggestions>
</>
) : (
messages.map((msg) => (
<Message key={msg.id} from={msg.role}>
<MessageContent>{msg.content}</MessageContent>
{/* Show reasoning if available */}
{msg.reasoning && (
<Reasoning isStreaming={isLoading && msg.id === messages.at(-1)?.id}>
<ReasoningTrigger />
<ReasoningContent>{msg.reasoning}</ReasoningContent>
</Reasoning>
)}
{/* Show sources if available */}
{msg.sources?.length > 0 && (
<Sources>
<SourcesTrigger count={msg.sources.length} />
<SourcesContent>
{msg.sources.map((src, i) => (
<Source key={i} href={src.url} title={src.title} />
))}
</SourcesContent>
</Sources>
)}
</Message>
))
)}
</ConversationContent>
<ConversationScrollButton />
</Conversation>
<form onSubmit={handleSubmit} className="border-t p-4">
<PromptInput
value={input}
onChange={(e) => setInput(e.target.value)}
placeholder="Type a message..."
disabled={isLoading}
/>
</form>
</div>
);
}
Styling
All components accept className prop for Tailwind customization:
<Message className="bg-muted/50 rounded-lg p-4">
<MessageContent className="text-sm">{content}</MessageContent>
</Message>
<Reasoning className="border-l-2 border-blue-500 pl-4">
<ReasoningTrigger className="text-blue-600" />
<ReasoningContent className="text-muted-foreground" />
</Reasoning>
Integration with AI SDK
These components work seamlessly with Vercel AI SDK hooks:
import { useChat } from 'ai/react';
import { useCompletion } from 'ai/react';
import { useAssistant } from 'ai/react';
// useChat for conversational interfaces
const { messages, input, handleSubmit } = useChat();
// useCompletion for single completions
const { completion, complete } = useCompletion();
// useAssistant for OpenAI Assistants
const { messages, submitMessage } = useAssistant();
Reference
See references/component-api.md for complete props documentation.