openui

thesysdevMIT活跃维护

一套生成式 UI 的开放标准,让大模型和 Agent 直接输出可交互的界面组件,而不是纯文本回复。

The Open Standard for Generative UI

@openuidev/[email protected]发布于 2026-11-09 16:59 UTC15,031star +106 / 7 天998fork同步于 2026-11-10 05:26 UTC

怎么上手

由 README 提炼,执行前请确认
npx @openuidev/cli@latest create --name genui-chat-app
硬件要求按 README 说明

README 未说明

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

用紧凑流式语言让模型直接生成可渲染 UI 的全栈框架

一套生成式 UI 的开放标准,让大模型和 Agent 直接输出可交互的界面组件,而不是纯文本回复。

核心能力

  • 用 OpenUI Lang 流式输出结构化 UI,比 JSON 省最多 67% token
  • 从组件库自动生成系统提示词,约束模型可生成的组件
  • 流式渲染器边收 token 边解析渲染,支持 React/Vue/Svelte/Angular
  • 内置图表、表单、表格、布局等组件库,可直接用或扩展
  • 提供 React 聊天界面与 headless 状态层,快速搭助手应用

容易踩的坑

需要自行接入 LLM 并生成系统提示词,框架本身不含模型;不同框架需装对应包(如 @openuidev/react-lang、vue-lang 等),核心包不含渲染器;模型输出格式错误时需自行调试或借助 openui skill 排查

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本@openuidev/[email protected]
  1. @openuidev/[email protected]最新正式版2026-11-09 · 2026-11-09 16:59 UTC

    Patch Changes

  2. @openuidev/[email protected]2026-11-06 · 2026-11-06 16:33 UTC
    查看更新说明

    Patch Changes

    • #1581 2bc06b5 Thanks @i-subham23! - DashboardCardHeader titles and EntityList values accept numbers and show them formatted. A number the model passed from a query (a star count, a fork count) made the component fail to render and the value disappear; a 0 showed as blank. Numbers now read like "4.1B", and timestamps like "Apr 1, 2026" (#1552).
  3. @openuidev/[email protected]2026-11-06 · 2026-11-06 16:14 UTC
    查看更新说明

    Patch Changes

    • #1575 adec1c1 Thanks @AbhinRustagi! - defineLiveArtifactRenderer (@openuidev/react-ui/cloud/agent-interface) shows OpenUI Cloud dashboards in AgentInterface: the dashboard tools' results become a card in the chat that opens the live dashboard in the side panel, and saved dashboards open in the artifact browser.
    • Updated dependencies []:
  4. @openuidev/[email protected]2026-11-06 · 2026-11-06 16:14 UTC
    查看更新说明

    No changes in this release.

  5. @openuidev/[email protected]2026-11-06 · 2026-11-06 16:14 UTC
    查看更新说明

    Patch Changes

    • #1583 fe9171c Thanks @AbhinRustagi! - setup-agent no longer adds a refresh-note comment to AGENTS.md. The refresh command now lives at the end of the OpenUI skill itself.

    • #1584 7864d61 Thanks @AbhinRustagi! - openui create usage analytics now record why sign-in was skipped, which prompt a cancel came from, how long the catalog and template or example clones take, and when the dev server is ready. The create funnel's existing steps are unchanged.

    • #1574 4fd85e4 Thanks @AbhinRustagi! - openui create now signs you in as the last step, after scaffolding and installing: press any key to generate an API key, or Esc to finish without one and add it later with generate-api-key. A THESYS_API_KEY already exported in your shell skips sign-in.

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    OpenUI - The Open Standard for Generative UI

    OpenUI is a full-stack, framework-agnostic Generative UI framework built around a compact, streaming-first language. A framework-agnostic core powers first-party runtimes for React, Vue, Svelte, and Angular, and React additionally ships built-in component libraries and ready-to-use chat interfaces. OpenUI Lang uses up to 67% fewer tokens than JSON.

    Docs · Playground · Discord · Contributing

    Important: OpenUI has no official cryptocurrency, token, or coin. Any asset using the OpenUI name is unaffiliated with this project and is not endorsed by its maintainers.


    What is OpenUI

    At the center of OpenUI is OpenUI Lang: a compact, streaming-first language for model-generated UI. Instead of treating model output as only text, OpenUI lets you define components, generate prompt instructions from that component library, and render structured UI as the model streams.

    Core capabilities:

    • OpenUI Lang - A compact language for structured UI generation designed for streaming output.
    • Built-in component libraries - Charts, forms, tables, layouts, and more, ready to use or extend.
    • Prompt generation from your component library - Generate model instructions directly from the components you allow.
    • Streaming renderer - Parse and render model output progressively in React, Vue, Svelte, or Angular as tokens arrive.
    • Chat and app surfaces - Use the same foundation for assistants, copilots, and broader interactive product flows.

    Quick Start

    npx @openuidev/cli@latest create --name genui-chat-app
    

    This is the fastest way to start with OpenUI. The scaffolded app gives you an end-to-end starting point with streaming, built-in UI, and OpenUI Lang support.

    What this gives you:

    • OpenUI Lang support - Start with structured UI generation built into the app flow.
    • Library-driven prompts - Generate instructions from your allowed component set.
    • Streaming support - Update the UI progressively as output arrives.
    • Working app foundation - Start from a ready-to-run example instead of wiring everything manually.

    How it works

    Your components define what the model can generate.

    flowchart LR
        A["Component Library"] --> B["System Prompt"]
        B --> C["LLM"]
        C --> D["OpenUI Lang Stream"]
        D --> E["Renderer"]
        E --> F["Live UI"]
    
    1. Define or reuse a component library.
    2. Generate a system prompt from that library.
    3. Send that prompt to your model.
    4. Stream OpenUI Lang output back to the client.
    5. Render the output progressively with Renderer.

    Try it yourself in the Playground: generate UI live with the default component library.

    Packages

    PackageBest forDescription
    @openuidev/lang-coreFramework-agnostic parsing and prompt generationCore parser, prompt-generation, runtime-evaluation, and type layer with no React, Angular, Vue, or Svelte dependency
    @openuidev/langchainLangChain and LangGraph agentsAgent transformer and server helpers that stream OpenUI through AG-UI
    @openuidev/react-langReact rendering runtimesDefine component libraries, generate prompts, and render streamed OpenUI Lang in React
    @openuidev/react-headlessBring-your-own React chat UIHeadless chat state, streaming adapters, and message format converters
    @openuidev/react-uiFastest path to a full React chat experiencePrebuilt chat layouts, standalone UI primitives, and two built-in component libraries
    @openuidev/react-emailEmail generation and HTML exportReact Email component definitions plus prompt options for model-generated emails
    @openuidev/assistant-uiassistant-ui appsTool UI renderers and instruction wiring for streaming OpenUI Lang inside assistant-ui
    @openuidev/vue-langVue integrationsVue 3 bindings for defining model-renderable components and rendering streamed OpenUI Lang
    @openuidev/svelte-langSvelte integrationsSvelte 5 bindings for defining model-renderable components and rendering streamed OpenUI Lang
    @openuidev/angular-langAngular integrationsAngular bindings for defining component libraries and rendering streamed OpenUI Lang
    @openuidev/browser-bundleCDN, iframe, and no-build embedsPrebuilt browser bundle that ships the renderer, UI library, React, and styles as script + stylesheet assets
    @openuidev/a2uiA2UI with OpenUI Lang component payloadsFramework-agnostic A2UI v1.0 protocol client with an optional React renderer
    @openuidev/serverServer side utilitiesServer utilities for OpenUI and OpenUI Gateway
    @openuidev/observability-cloudHosted observability in the Thesys consoleCloud sink that batches OpenUI events and ships them to OpenUI Gateway
    @openuidev/cliProject scaffolding and prompt generationCLI for creating new apps and generating system prompts or JSON schema from a library definition
    @openuidev/openclaw-os-pluginOpenClaw workspacesOpenClaw OS plugin for serving OpenUI-powered OpenClaw workspaces

    Common starting points:

    # React app with OpenUI rendering and prebuilt components
    npm install @openuidev/react-lang @openuidev/react-ui
    
    # Framework-agnostic backend or Edge prompt generation
    npm install @openuidev/lang-core
    
    # LangChain/LangGraph agent and server integration
    npm install @openuidev/langchain @langchain/langgraph
    
    # Vue, Svelte, or Angular runtime
    npm install @openuidev/vue-lang
    npm install @openuidev/svelte-lang
    npm install @openuidev/angular-lang
    
    # A2UI protocol with OpenUI Lang component payloads
    npm install @openuidev/a2ui zod
    

    Why OpenUI Lang

    OpenUI Lang is designed for model-generated UI that needs to be both structured and streamable.

    • Streaming output - Emit UI incrementally as tokens arrive.
    • Token efficiency - Up to 67% fewer tokens than equivalent JSON (see benchmarks).
    • Controlled rendering - Restrict output to the components you define and register.
    • Typed component contracts - Define component props and structure up front with Zod schemas.

    Token efficiency benchmarks

    Measured with tiktoken (GPT-5 encoder). OpenUI Lang vs two JSON-based streaming formats across seven UI scenarios:

    ScenarioVercel JSON-RenderThesys C1 JSONOpenUI Langvs Vercelvs C1
    simple-table340357148-56.5%-58.5%
    chart-with-data520516231-55.6%-55.2%
    contact-form893849294-67.1%-65.4%
    dashboard224722611226-45.4%-45.8%
    pricing-page248723791195-52.0%-49.8%
    settings-panel12441205540-56.6%-55.2%
    e-commerce-product244923811166-52.4%-51.0%
    TOTAL1018099484800-52.8%-51.7%

    Full methodology and reproduction steps in benchmarks/.

    Documentation

    Detailed documentation is available at openui.com.

    Repository structure

    openui/
    ├── packages/
    │   ├── react-lang/       # Core runtime (parser, renderer, prompt generation)
    │   ├── react-headless/   # Headless chat state & streaming adapters
    │   ├── react-ui/         # Prebuilt chat layouts & component libraries
    │   ├── react-email/      # React Email component library for generated emails
    │   ├── assistant-ui/     # assistant-ui Tool UI renderers for OpenUI Lang
    │   ├── lang-core/        # Framework-agnostic parser, prompt, and runtime layer
    │   ├── langchain/        # LangChain/LangGraph streaming integration
    │   ├── vue-lang/         # Vue runtime bindings for OpenUI Lang
    │   ├── svelte-lang/      # Svelte runtime bindings for OpenUI Lang
    │   ├── angular-lang/     # Angular runtime bindings for OpenUI Lang
    │   ├── browser-bundle/   # Script-tag bundle for CDN / iframe / no-build embeds
    │   ├── a2ui/             # A2UI protocol with OpenUI Lang component payloads
    │   ├── server/           # Server utilities for OpenUI & OpenUI Gateway
    │   ├── observability/    # Framework-free observability event bus
    │   ├── observability-cloud/ # Cloud sink shipping OpenUI events to Thesys
    │   ├── devtools/         # Dev-only OpenUI Inspect widget
    │   └── openui-cli/       # CLI for scaffolding & prompt generation
    ├── examples/             # Cookbooks and integration reference implementations
    │   ├── agent-frameworks/
    │   ├── app-frameworks/
    │   ├── cookbooks/
    │   ├── design-systems/
    │   ├── harnesses/
    │   └── miscellaneous/
    ├── docs/                 # Documentation site (openui.com)
    └── benchmarks/           # Token efficiency benchmarks
    

    Good places to start:

    Community

    • Discord - Ask questions, share what you're building
    • GitHub Issues - Report bugs or request features

    How OpenUI compares

    FeatureOpenUIjson-render (Vercel)A2UI (Google)CopilotKit OpenGenUI
    Tokens1x3x3x4x
    Latency (60 tok/s)4.9s14.2s14.2s~20s
    StreamingYesYesYesPartial
    Consistent outputYesYesYesNo
    ComponentsLibrary + customLibrary + customCustom onlyNone
    Multi-platformWeb, mobile, emailWeb, mobile, PDF, email, videoWeb, iOS, AndroidWeb
    Built-in data fetchingYesNoNoNo
    Chat UI includedYesNoNoYes

    For more details, refer to the official OpenUI Lang comparison documentation.

    Adopters

    A list of organizations and projects using OpenUI is maintained in ADOPTERS.md. If you're using OpenUI, please consider adding your organization; it helps the project gain momentum and helps other adopters find peers using OpenUI in similar contexts.

    Contributing

    Contributions are welcome. See CONTRIBUTING.md for contribution guidelines and ways to get involved.

    Agent Skill

    OpenUI ships an Agent Skill so AI coding assistants (Claude Code, Codex, Cursor, Copilot, etc.) can help you scaffold, build, and debug Generative UI apps using OpenUI Lang.

    The skill is maintained in the thesysdev/skills repository.

    Install

    # With the skills CLI (works across all agents)
    npx skills add thesysdev/skills --skill openui
    

    The skill covers component library design, OpenUI Lang syntax, system prompt generation, the Renderer, SDK packages, and debugging malformed LLM output.

    Feedback

    Found a bug or have an idea? Open an issue, or send anonymous feedback from your terminal:

    npx @openuidev/cli feedback "Describe the problem or idea"
    

    Coding agents using the OpenUI skill can send feedback for you. They remove personal details and code from the message and ask for your approval before sending it.

    License

    This project is available under the terms described in LICENSE.