AI Elements Vue
repository·main·Indexed 22 days ago
https://github.com/vuepont/ai-elements-vueA collection of pre-built, customizable Vue components designed for AI applications, including chatbot interfaces, workflow visualizations, and vibe-coding tools. It integrates with shadcn-vue and the Vercel AI SDK, targeting Vue 3 and Tailwind CSS 4. Components are installed directly into the local codebase via a dedicated CLI or the shadcn-vue CLI for full customization.
What's inside ai-elements-vue
- AI Elements Vue is a component library designed to accelerate the development of AI-native applications. It is built on top of shadcn-vue, utilizing its design system to provide specialized components with modern UI patterns tailored for AI interactions. The library uses Tailwind CSS for styling and TypeScript for type safety and enhanced developer experience.
Overview of the Message component suite
mainThe
Messagecomponent suite is designed for building chat interfaces. It provides tools for:- Displaying messages from both users and AI assistants.
- Managing multiple response branches (branching).
- Adding action buttons to messages.
- Rendering markdown content within chat responses.
Overview of the Attachments component
mainTheAttachmentscomponent is a flexible and composable UI element designed for displaying file attachments and source documents. It supports various media types including files, images, videos, audio, and source documents, and offers multiple layout variants to suit different UI needs.Overview of the Mic Selector component
mainThe
MicSelectoris a composable dropdown component designed for selecting audio input devices. It is built on top ofshadcn-vue'sCommandandPopovercomponents.Key features include:
- Automatic device detection: Identifies available microphones in the user's environment.
- Permission handling: Manages the lifecycle of microphone access permissions.
- Dynamic updates: Detects and updates the list of devices when hardware changes (e.g., plugging in a new USB mic).
- Intelligent parsing: Automatically parses device names for better readability.
Overview of the EnvironmentVariables component
mainThe
EnvironmentVariablescomponent is designed to display environment variables in a user interface. It includes built-in support for:- Value masking: Hiding sensitive information by default.
- Visibility toggle: Allowing users to reveal or hide values.
- Copy functionality: Enabling users to quickly copy variable values to their clipboard.
Overview of the Commit component
mainThe
Commitcomponent is designed to display detailed commit information. It provides a structured way to show:- Commit hash
- Commit message
- Author details
- Timestamp
- List of changed files
Features of the OpenIn component
mainThe
OpenIncomponent provides a set of pre-configured links to popular AI chat platforms, allowing users to export their current query to an external AI assistant.Key capabilities include:
- Context-based query passing: Automatically encodes and passes queries to the target platform.
- Supported Platforms: ChatGPT, Claude, T3 Chat, Scira AI, v0, and Cursor.
- Customization: Supports a customizable dropdown trigger button and additional CSS classes for the content area.
- Accessibility: Includes an accessible dropdown menu with keyboard navigation and external link indicators.
PromptInput Features and Capabilities
mainThe
PromptInputcomponent is a feature-rich input system for AI chat interfaces, including:- Text Handling: Auto-resizing textarea, customizable min/max height, and keyboard shortcuts (Enter to submit, Shift+Enter for new line).
- Attachments: File attachment support with drag-and-drop, image previews, and configurable constraints (max files, max size, accepted types).
- Voice: Built-in native speech recognition button using the Web Speech API.
- Tools & Actions: Flexible toolbar (
PromptInputTools) for custom actions, model selection dropdowns, and web search toggles. - UX: Automatic submit button icon updates based on status, global document drop support (via
global-dropprop), and responsive mobile-friendly design.
Use the StackTrace component
mainThe
StackTracecomponent parses standard JavaScript/Node.js stack trace strings and displays them in a formatted, interactive UI. It features error type highlighting, dimming of internal frames (likenode_modules), collapsible content, and clickable file paths.Key Features
- Parsing: Automatically handles standard JS/Node.js stack trace formats.
- Visuals: Highlights error types in red and dims internal frames.
- Interactivity: Supports collapsing/expanding, copying the full trace to the clipboard, and clicking file paths to trigger actions.
- Customization: Allows hiding internal frames and using slots for custom error types or messages.
Features of the Commit component
mainThe
Commitcomponent suite provides a complete UI for displaying git-style commit information, including:- Commit hash display: Includes a built-in copy button.
- Author details: Displays author avatars with initials.
- Timestamps: Supports relative timestamp formatting.
- File changes: A collapsible list of changed files featuring:
- Color-coded file status (added, modified, deleted, renamed).
- Line addition and deletion counts.
Features of the Message component
mainThe
Messagecomponent provides a rich set of features for AI chat interfaces:- Styling: Distinct alignment and styling for user vs. assistant messages.
- Response Branching: Navigation controls to switch between multiple AI response versions.
- Markdown & Math: GFM support (tables, task lists, etc.), math equations, and smart streaming.
- Action Buttons: Built-in support for retry, like, dislike, copy, and share with tooltips.
- Code Blocks: Syntax highlighting and copy-to-clipboard functionality.
- Attachments: Support for images and generic files (Note: Attachment components are managed in a separate module).
- Accessibility: Keyboard accessible with proper ARIA labels.
- Theming: Seamless light/dark mode integration.
What is the Context component?
mainThe
Contextcomponent is a compound component system used to provide a comprehensive view of AI model usage. It is designed to show:- Context window utilization: How much of the model's available context is being used.
- Token consumption breakdown: Detailed usage for input, output, reasoning, and cache tokens.
- Cost estimation: Interactive cost calculations, typically presented via a hover card interface.