Introduction
What is AI Elements Vue and why you should use it.
AI Elements Vue is the Vue port of AI-Elements, a component library and custom registry built on top of shadcn-vue to help you build AI-native applications faster. It provides pre-built components like conversations, messages and more.
Installing AI Elements Vue 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-vue 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 Vue.
Prerequisites
Before installing AI Elements, make sure your environment meets the following requirements:
- Node.js, version 18 or later
- A Vue.js or Nuxt.js project with the AI SDK installed.
- shadcn-vue 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.
AI Elements is built targeting Vue 3 and Tailwind CSS 4.
Installing Components
You can install AI Elements Vue components using either the AI Elements Vue CLI or the shadcn-vue 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-vue 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.