GitHub 37
Skip to content
ViteHub is still experimental. Expect bugs and breaking changes.

ViteHub UI

Build UI that people and Agents use: ui-sdk parts with the kit, UI specs that an Agent sends, and the live page that an Agent works.

An Agent meets UI in three ways. It builds UI as code, sends UI as a spec, or works the live page that a person has open. ViteHub UI gives each way one owner.

WayWhat you use
Build UI as codeui-sdk parts from @ui-sdk/vue, plus @vite-hub/kit for the parts and styles that ui-sdk does not have
Send UI as a specThe Agent UI catalog in vite-hub/agent/ui, paired with forms from @vite-hub/forms
Work the live pageThe page() Capability, with connectPage() from vite-hub/agent/page

Import each part from its @ui-sdk/vue entry. Every part handles behavior, focus, keyboard navigation, and ARIA, and has no styles. @vite-hub/kit adds the parts that ui-sdk does not have, today TagsInput, and a style family for every part.

<script setup lang="ts">
import {
  Dialog,
  DialogContent,
  DialogTitle,
  DialogTrigger,
} from "@ui-sdk/vue/dialog"
import { Field, FieldLabel } from "@ui-sdk/vue/field"
import { Input } from "@ui-sdk/vue/input"
</script>

<template>
  <Dialog>
    <DialogTrigger>Rename</DialogTrigger>
    <DialogContent>
      <DialogTitle>Rename the project</DialogTitle>
      <Field>
        <FieldLabel>Project name</FieldLabel>
        <Input default-value="Apollo" />
      </Field>
    </DialogContent>
  </Dialog>
</template>
app/components/RenameDialog.vue

Read Get started to install the parts and styles.

An Agent can reply with UI instead of text, such as an approval card. It writes a json-render spec, and vite-hub/agent/ui checks it against the catalog of parts that it may send:

{
  "root": "card",
  "elements": {
    "card": {
      "type": "Card",
      "props": { "title": "Deploy acme/web" },
      "children": ["approve"]
    },
    "approve": {
      "type": "Button",
      "props": { "label": "Approve", "variant": "primary" },
      "on": {
        "press": { "action": "event", "params": { "name": "deploy.approve" } }
      }
    }
  }
}
approval.json

A spec has no inputs of its own. To ask for values, a Form names a form from @vite-hub/forms, so one schema makes the web form, the MCP elicitation, and the Slack modal. Agent UI shows how to define the catalog, check a spec, and render it. See also one schema on every surface and Forms in Vue.

The page() Capability lets a server Agent read and change the page that a person has open, through ui-sdk's agent bridge. You set which parts it may not touch and which steps need approval:

import { defineAgent } from "vite-hub/agent"
import { page } from "vite-hub/agent/capabilities"
import { webChat } from "vite-hub/channels/adapters"

export default defineAgent({
  capabilities: [page({ requireApproval: [{ label: "Save changes" }] })],
  channels: { web: webChat() },
  driver: { model: "openai/gpt-5" },
})
server/agents/settings.ts

Read Page for client setup, undo, and the security model.