🚀 Socket Launch Week Day 4:Socket MCP Adds Org Alerts, Threat Feed Review, and Package Inspection.Learn more
Sign In

@vkdevfolio/a2ui-vue

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vkdevfolio/a2ui-vue

Vue 3 renderer for Google A2UI protocol — render agent-generated UI components with Tailwind CSS

latest
Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
37
42.31%
Maintainers
1
Weekly downloads
 
Created
Source

A2 UI Vue

A2UI Vue

A Vue 3 renderer and composer for the Google A2UI protocol — stream structured UI from AI agents to your Vue/Nuxt app in real time.

npm version Vue 3 MIT License PRs Welcome

Quick Start · Components · Protocol · Examples · Contributing

What is A2UI?

Google's A2UI protocol lets AI agents stream rich, interactive UI to a frontend application — without the frontend knowing anything about the AI. The agent produces structured JSON describing a widget tree; the renderer turns it into real Vue components.

A2UI Vue is the first open-source Vue 3 implementation of this protocol. It ships:

  • 🎨 <A2StaticRenderer> — render any A2UI JSON without an agent (perfect for galleries and prototyping)
  • <A2Surface> — live SSE connection to an A2UI-speaking agent; components stream in and update reactively
  • 🧩 24 components — layout, content, input, navigation — all Apple-quality polished
  • 🌗 Dark & light mode — seamless CSS-variable-based theming
  • 🔌 LLM-agnostic — works with OpenAI, Anthropic, Gemini — any backend that speaks A2UI

Screenshots

Gallery light mode

Gallery dark mode

Component Reference

Components page

Icons Browser (316 Material Icons)

Icons page

AI Designer — JSON Editor + Live Preview

Designer page

Add screenshots: Drop PNG/JPG files into docs/screenshots/ with the names above, or replace the paths with your own hosted image URLs.

✨ Features

FeatureDetails
A2UI v0.8 + v0.10Supports both protocol versions simultaneously
Streaming SSEComponents render and update token-by-token as the agent streams
Reactive data modelJSON Pointer paths (/user/name) bind live to any component
Static rendering<A2StaticRenderer> for galleries, demos, and testing
24 componentsRow, Column, List, Card, Tabs, Modal, Text, Image, Icon, Video, AudioPlayer, Badge, Progress, Rating, Avatar, Alert, Stat, TextField, CheckBox, ChoicePicker, Slider, DateTimeInput, Button, Divider
Custom media playersFull custom video and audio player UIs (no browser defaults)
Glassmorphismbackdrop-filter: blur() cards, modals, and overlays
316 Material IconsSearchable icon browser built-in
Python backend exampleFastAPI + LangGraph + multi-LLM factory

🚀 Quick Start

1. Install

npm install @vkdevfolio/a2ui-vue
# or
pnpm add @vkdevfolio/a2ui-vue

2. Register the plugin

// main.ts
import { createApp } from 'vue'
import { A2UIPlugin } from '@vkdevfolio/a2ui-vue'
import '@vkdevfolio/a2ui-vue/style.css'
import App from './App.vue'

createApp(App)
  .use(A2UIPlugin)
  .mount('#app')

3. Render a static widget

<template>
  <A2StaticRenderer :components="widgetJson" />
</template>

<script setup>
import { A2StaticRenderer } from '@vkdevfolio/a2ui-vue'

const widgetJson = [
  {
    id: 'root',
    component: {
      Card: { child: 'col', padding: 20 }
    }
  },
  {
    id: 'col',
    component: {
      Column: {
        children: { explicitList: ['title', 'body'] }
      }
    }
  },
  {
    id: 'title',
    component: { Text: { text: 'Hello A2UI!', variant: 'h2' } }
  },
  {
    id: 'body',
    component: { Text: { text: 'Rendered from JSON in Vue 3.' } }
  }
]
</script>

4. Connect to a live agent

<template>
  <A2Surface agent-url="http://localhost:8000/a2ui" />
</template>

<script setup>
import { A2Surface } from '@vkdevfolio/a2ui-vue'
</script>

🧩 Components

Layout

ComponentDescription
RowHorizontal flex container with alignment/distribution
ColumnVertical flex container
ListRepeating list with template children
CardGlassmorphic card with optional background color
TabsTab bar with sliding indicator
ModalOverlay dialog with blur backdrop and spring animation
DividerHorizontal or vertical separator

Content

ComponentDescription
TextTypography scale: h1–h5, body, caption, label + inline markdown
ImageLazy-loading image with shimmer skeleton; variants: avatar, icon, smallFeature, mediumFeature, largeFeature, header, cover, banner
IconMaterial Icons by name with size and color props
VideoFull custom HTML5 video player: seek bar, buffered track, volume, fullscreen, auto-hide controls
AudioPlayerCustom audio player: spinning cover disc, ±10s skip, progress bar, volume popup
BadgePill label — success / warning / error / info / neutral
ProgressAnimated linear or circular progress bar
RatingInteractive star rating (0–5) with half stars
AvatarImage or initials avatar with status dot
AlertSeverity-colored alert — info / success / warning / error; dismissible
StatLarge stat value + label + trend direction badge

Input

ComponentDescription
TextFieldFloating-label text / number / password / textarea with focus ring
CheckBoxCustom animated checkbox with gradient fill
ChoicePickerChips, radio, or checkbox picker with optional search
SliderCustom range slider with value tooltip
DateTimeInputDate / time / datetime picker with floating label

Navigation

ComponentDescription
ButtonPrimary (gradient), default (border), or borderless — with press animation

📡 Protocol

A2UI Vue supports both v0.8 and v0.10 of the A2UI protocol simultaneously.

Server → Client messages

v0.10v0.8Description
createSurfacebeginRenderingStart a new widget surface
updateComponentssurfaceUpdateAdd/update component definitions
updateDataModeldataModelUpdateUpdate reactive data bound to components
deleteSurfaceRemove a surface

Dynamic values

Components accept static strings or dynamic references:

{ "text": "Hello" }
{ "text": { "path": "/user/name" } }
{ "text": { "literalString": "World" } }

Actions

User interactions post back to the agent:

{
  "action": "button-click",
  "surfaceId": "my-surface",
  "componentId": "submit-btn",
  "payload": {}
}

🐍 Python Backend Example

The example-python/ directory contains a FastAPI + LangGraph backend:

  • Multi-LLM factory — switch between OpenAI, Anthropic, and Gemini via LLM_PROVIDER env var
  • Designer sub-agent — generates valid A2UI JSON from natural language descriptions
  • Built-in tools — weather card, user profile, task manager, login form, stats dashboard
cd example-python
pip install -r requirements.txt
cp .env.example .env   # add your API key
python server.py
LLM_PROVIDER=openai   # openai | anthropic | google
OPENAI_API_KEY=sk-...
# ANTHROPIC_API_KEY=sk-ant-...
# GOOGLE_API_KEY=...

🖥️ Nuxt Example App

The example-nuxt/ directory is a full Composer experience:

PageDescription
CreateDescribe a widget in chat — the agent streams it live
Gallery20+ pre-built widgets rendered from static A2UI JSON
DesignerJSON editor + live preview + AI assistant
ComponentsFull component reference with props tables and live previews
IconsSearchable grid of 316 Material Icons
cd example-nuxt
pnpm install
pnpm dev
# open http://localhost:3000

Note: Requires Node.js 18+. The dev script includes --max-old-space-size=4096 for larger builds.

🏗️ Repository Structure

a2ui-vue/
├── src/                    # NPM package source
│   ├── components/
│   │   ├── layout/         # Row, Column, List, Card, Tabs, Modal, Divider
│   │   ├── content/        # Text, Image, Icon, Video, AudioPlayer, Badge…
│   │   ├── input/          # TextField, CheckBox, ChoicePicker, Slider…
│   │   └── navigation/     # Button
│   ├── composables/        # useA2UI, useSurface, useDataModel
│   ├── protocol/           # SSE parser + action emitter
│   ├── functions/          # Built-in validation & formatting functions
│   └── theme/              # CSS variable tokens (dark/light)
├── example-nuxt/           # Nuxt 3 Composer app
├── example-python/         # FastAPI + LangGraph backend
└── docs/                   # Documentation assets & screenshots

🎨 Theming

All components use CSS custom properties. Override in your app:

:root {
  --a2ui-primary: #7c3aed;
  --a2ui-bg-surface: #ffffff;
  --a2ui-text: #111113;
  --a2ui-card-bg: rgba(255, 255, 255, 0.72);
  --a2ui-card-border: rgba(0, 0, 0, 0.08);
}

.dark {
  --a2ui-bg-surface: #14141f;
  --a2ui-text: #e8e8f0;
  --a2ui-card-bg: rgba(37, 37, 64, 0.8);
}

🤝 Contributing

Contributions are very welcome! This project is in active development.

Ways to contribute

  • 🐛 Bug reports — open an issue with reproduction steps
  • 💡 Feature requests — describe your use case in an issue
  • 🧩 New components — follow the component pattern in src/components/
  • 📝 Documentation — improve examples, fix typos, add usage notes
  • 🔌 Backend integrations — add TypeScript/Node.js, Go, or other backends
  • 🎨 Gallery widgets — add new pre-built widget examples

Development setup

# Clone
git clone https://github.com/your-org/a2ui-vue.git
cd a2ui-vue

# Install + build package
pnpm install
pnpm build

# Run example app
cd example-nuxt
pnpm install
pnpm dev

Adding a component

  • Create src/components/<category>/A2YourComponent.vue
  • Register in src/components/A2Renderer.vue
  • Export from src/index.ts
  • Add a TypeScript interface in src/types.ts
  • Add a preview in example-nuxt/pages/components.vue

See CONTRIBUTING.md for the full guide, code style, and PR checklist.

📄 License

MIT — see LICENSE for details.

🙏 Acknowledgements

Built with ❤️  ·  Star it if you find it useful ⭐

Keywords

a2ui

FAQs

Package last updated on 22 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts