AI Elements Vue is an unofficial community-led Vue port of AI Elements.
Note
We are not affiliated with AI Elements, but the project has the author’s encouragement and support.
This is a project born out of the need for a similar project for the Vue ecosystem.
AI Elements Vue is a component library built on top of shadcn-vue to help you build AI-native applications faster. It provides pre-built, customizable Vue components specifically designed for AI applications, including conversations, messages, code blocks, reasoning displays, and more. The CLI makes it easy to add these components to your Vue.js or Nuxt.js project.
You can use the AI Elements Vue CLI directly with npx, or install it globally:
# Use directly (recommended)
npx ai-elements-vue@latest
# Or using shadcn-vue cli
npx shadcn-vue@latest add https://registry.ai-elements-vue.com/all.jsonBefore using AI Elements Vue, ensure your project meets these requirements:
- Node.js 18 or later
- Vue.js, Nuxt.js project with AI SDK installed
- shadcn-vue initialized in your project (
npx shadcn-vue@latest init) - Tailwind CSS configured (AI Elements Vue supports CSS Variables mode only)
Install all available AI Elements Vue components at once:
npx ai-elements-vue@latestThis command will:
- Set up shadcn-vue if not already configured
- Install all AI Elements Vue components to your configured components directory
- Add necessary dependencies to your project
Install individual components using the add command:
npx ai-elements-vue@latest add <component-name>Examples:
# Install the message component
npx ai-elements-vue@latest add message
# Install the conversation component
npx ai-elements-vue@latest add conversation
# Install the code-block component
npx ai-elements-vue@latest add code-blockYou can also install components using the standard shadcn-vue CLI:
# Install all components
npx shadcn-vue@latest add https://registry.ai-elements-vue.com/all.json
# Install a specific component
npx shadcn-vue@latest add https://registry.ai-elements-vue.com/message.jsonAI Elements Vue includes the following components:
| Component | Status | Description |
|---|---|---|
message |
✅ 已完成 | Individual chat messages with avatars |
conversation |
✅ 已完成 | Container for chat conversations |
response |
✅ 已完成 | Formatted AI response display |
prompt-input |
✅ 已完成 | Advanced input component with model selection |
actions |
❌ 未完成 | Interactive action buttons for AI responses |
branch |
❌ 未完成 | Branch visualization for conversation flows |
code-block |
❌ 未完成 | Syntax-highlighted code display with copy functionality |
image |
❌ 未完成 | AI-generated image display component |
inline-citation |
❌ 未完成 | Inline source citations |
loader |
❌ 未完成 | Loading states for AI operations |
reasoning |
✅ 已完成 | Display AI reasoning and thought processes |
source |
❌ 未完成 | Source attribution component |
suggestion |
✅ 已完成 | Quick action suggestions |
task |
✅ 已完成 | Task completion tracking |
tool |
✅ 已完成 | Tool usage visualization |
chain-of-thought |
✅ 已完成 | Transparent reasoning timeline |
The AI Elements Vue CLI:
- Detects your package manager (npm, pnpm, yarn, or bun) automatically
- Fetches component registry from
https://registry.ai-elements-vue.com/all.json - Installs components using the shadcn-vue CLI under the hood
- Adds dependencies and integrates with your existing shadcn-vue setup
Components are installed to your configured shadcn-vue components directory (typically @/components/ai-elements/) and become part of your codebase, allowing for full customization.
AI Elements Vue uses your existing shadcn-vue configuration. Components will be installed to the directory specified in your components.json file.
For the best experience, we recommend:
- AI Gateway: Set up Vercel AI Gateway and add
AI_GATEWAY_API_KEYto your.env.local - CSS Variables: Use shadcn-vue's CSS Variables mode for theming
- TypeScript: Enable TypeScript for better development experience
If you'd like to contribute to AI Elements Vue, please follow these steps:
- Fork the repository
- Create a new branch
- Make your changes to the components in
packages/elements. - Open a PR to the
mainbranch.
Made with ❤️ by cwandev