assistant-ui-vue
August 23, 2025 ยท View on GitHub
A Vue 3 port of assistant-ui, providing composables and components for building AI assistant interfaces.
Overview
assistant-ui-vue is a comprehensive Vue 3 library for building AI-powered chat interfaces. It provides a set of highly customizable components and composables that work seamlessly with popular AI SDKs like Vercel AI SDK, LangGraph, and more.
Features
- ๐ Vue 3 Composition API - Built from the ground up for Vue 3
- ๐จ Fully Customizable - Override any component or styling
- ๐ Multiple Integrations - Works with Vercel AI SDK, LangGraph, and custom backends
- ๐ฑ Responsive - Mobile-friendly out of the box
- ๐ฏ TypeScript - Full TypeScript support
- โก Performance - Optimized for real-time streaming
Installation
npm install @assistant-ui/vue
Quick Start
Basic Example with Vercel AI SDK
<template>
<AssistantRuntimeProvider :runtime="runtime">
<Thread />
</AssistantRuntimeProvider>
</template>
<script setup lang="ts">
import { AssistantRuntimeProvider, Thread } from '@assistant-ui/vue';
import { useChatRuntime } from '@assistant-ui/vue-ai-sdk';
const runtime = useChatRuntime({
api: '/api/chat'
});
</script>
Server Setup (Node.js)
// server.js
import express from 'express';
import { openai } from '@ai-sdk/openai';
import { streamText } from 'ai';
const app = express();
app.post('/api/chat', async (req, res) => {
const { messages } = req.body;
const result = streamText({
model: openai('gpt-4'),
messages,
});
result.toDataStreamResponse().pipe(res);
});
app.listen(3001);
Packages
This monorepo contains the following packages:
Core Packages
@assistant-ui/vue- Core Vue components and composables@assistant-ui/vue-ai-sdk- Vercel AI SDK integration@assistant-ui/vue-langgraph- LangGraph integration@assistant-ui/vue-markdown- Markdown rendering support@assistant-ui/vue-syntax-highlighter- Code syntax highlighting
Utility Packages
assistant-stream- Framework-agnostic streaming utilities@assistant-ui/cloud- Cloud services integration@assistant-ui/styles- Default CSS styles and themes
Examples
The repository includes several example applications:
basic-example- Simple chat interfacewith-ai-sdk-v5- Vercel AI SDK v5 integrationwith-cloud- Cloud services integrationwith-external-store- Custom state managementwith-ffmpeg- Media processing capabilitieswith-langgraph- LangGraph agent integrationwith-parent-id-grouping- Message threading
To run an example:
cd examples/basic-example
npm install
npm run dev:all # Starts both frontend and backend
Components
Thread Components
ThreadRoot- Root container for the threadThreadViewport- Scrollable message areaThreadMessages- Message list containerThreadEmpty- Empty state componentThreadScrollToBottom- Scroll to bottom button
Message Components
MessageRoot- Message containerMessageContent- Message content displayMessageIf- Conditional renderingMessageProvider- Message context provider
Composer Components
ComposerRoot- Composer containerComposerInput- Text input fieldComposerSend- Send buttonComposerCancel- Cancel button
Action Components
ActionBarRoot- Action bar containerActionBarCopy- Copy buttonActionBarReload- Reload buttonActionBarEdit- Edit button
Composables
Core Composables
import {
useThread,
useMessage,
useComposer,
useAssistantRuntime
} from '@assistant-ui/vue';
// In your component
const thread = useThread();
const message = useMessage();
const composer = useComposer();
const runtime = useAssistantRuntime();
Styling
The library comes with default styles that can be imported:
import '@assistant-ui/styles/base.css';
import '@assistant-ui/styles/themes/default.css';
You can also create custom themes by overriding CSS variables:
:root {
--aui-primary-color: #007bff;
--aui-background-color: #ffffff;
--aui-text-color: #333333;
/* ... more variables */
}
TypeScript Support
The library is written in TypeScript and provides full type definitions. Configure your tsconfig.json:
{
"compilerOptions": {
"jsx": "preserve",
"moduleResolution": "bundler",
"types": ["@assistant-ui/vue"]
}
}
Browser Support
- Chrome/Edge (latest)
- Firefox (latest)
- Safari (latest)
- Mobile browsers (iOS Safari, Chrome Mobile)
Development
Setup
# Install dependencies
pnpm install
# Build all packages
pnpm build
# Run tests
pnpm test
# Start development
pnpm dev
Project Structure
assistant-ui-vue/
โโโ packages/ # Library packages
โ โโโ vue/ # Core Vue components
โ โโโ vue-ai-sdk/ # AI SDK integration
โ โโโ ...
โโโ examples/ # Example applications
โโโ apps/ # Documentation and tools
โโโ agent/ # Development notes and plans
Migration from React
If you're migrating from @assistant-ui/react, the Vue port maintains API compatibility where possible:
- Component names remain the same
- Props are similar (adapted for Vue conventions)
- Composables replace React hooks (useThread โ useThread)
- Slots replace React children/render props
Contributing
Contributions are welcome! Please read our contributing guidelines before submitting PRs.
Testing
When adding new features, please include tests:
# Run all tests
pnpm test
# Run tests in watch mode
pnpm test:watch
# Run tests with coverage
pnpm test:coverage
License
MIT
Acknowledgments
This is a Vue 3 port of the excellent assistant-ui library. Special thanks to the original authors and contributors.
Support
- ๐ Documentation (React docs - Vue docs coming soon)
- ๐ฌ Discord Community
- ๐ Issue Tracker