ai-elements

AI Elements 是一個基於 shadcn/ui 的元件庫與自訂註冊表,協助您更快地建立 AI 原生應用程式。

ai-elements 是什麼?

AI Elements 是一個基於 shadcn/ui 的元件庫與自訂註冊表,協助您更快地建立 AI 原生應用程式。

ai-elements 概覽

這是什麼

AI Elements 是一個基於 shadcn/ui 建立的元件庫與自訂註冊表,提供預先建置、可自訂的 React 元件,專為 AI 原生應用程式設計,包含對話、訊息、程式碼區塊與推理顯示等元件。該專案由 Vercel 維護,需搭配已安裝 AI SDK 與 shadcn/ui 的 Next.js 專案使用。請注意,AI Elements 正在遷移至 shadcn/ui,將於 2026 年 11 月底停止維護,由 shadcn/ui 版本的 AI Elements 取代。新專案應在 shadcn/ui 版本可用後使用該版本。

主要功能

  • 專為 AI 應用設計的預建 React 元件(對話、訊息、程式碼區塊等) - 透過 npx 或 shadcn CLI 安裝元件的 CLI 工具 - 自動偵測套件管理器(npm、pnpm、yarn、bun) - 元件會納入專案程式碼庫,可完全自訂 - 與現有 shadcn/ui 設定及 CSS Variables 模式整合

使用情境

AI Elements 適用於使用 Next.js 開發 AI 原生網頁應用程式的開發者。使用情境包括建立具備對話與訊息元件的聊天介面、顯示語法高亮的程式碼區塊、呈現推理或逐步 AI 輸出,以及建置需要與 AI SDK 及 shadcn/ui 主題緊密整合的自訂 AI 使用者介面。

快速開始

確保專案符合先決條件:Node.js 18 以上、已安裝 AI SDK 的 Next.js 專案、已初始化 shadcn/ui(npx shadcn@latest init),以及已設定 CSS Variables 模式的 Tailwind CSS。安裝所有元件: bash npx ai-elements@latest 安裝特定元件: bash npx ai-elements@latest add message npx ai-elements@latest add conversation npx ai-elements@latest add code-block 或者使用 shadcn CLI: bash npx shadcn@latest add https://elements.ai-sdk.dev/api/registry/all.json

授權與價格

提供的後設資料與 README 中未說明授權條款。該專案分類為開放原始碼。

內容整理自該專案公開的 README 與儲存庫資訊。

將此徽章加入你的 README

Featured on YunoDB 徽章樣式與說明

你是這個專案的維護者嗎?展示它已收錄於 YunoDB。

Markdown[![Featured on YunoDB](https://yunodb.com/badge/vercelai-elements.svg)](https://yunodb.com/tools/vercelai-elements?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/vercelai-elements?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/vercelai-elements.svg" alt="Featured on YunoDB" height="20"></a>