Skip to content
FossShelf
Home / Categories / For AI Engineers

Openui

Open standard for generative UI in AI apps

Replaces —

15.28K starsMITlast commit 15 Nov 2026
Screenshot of Openui

Who it's for

AI assistant with rich responses

Teams building chat interfaces where responses include charts, data tables, forms, or dashboards rather than prose. OpenUI lets the model decide which component to render based on the query, using the component library as the allowed output vocabulary.

You only need plain text or markdown responses from your AI assistant.

AI agent with interactive output

Agent developers using LangChain, LangGraph, or Vercel AI SDK who want agent actions to surface as interactive UI. The `@openuidev/langchain` package streams OpenUI through AG-UI without restructuring existing agent graphs.

Your agent output is consumed programmatically rather than rendered in a browser.

Copilot or AI-powered feature inside an existing product

Product engineers adding an AI layer to an existing app who want the AI responses to match the product's design system. Registering your own component library means the model can only generate components you have approved, keeping the output on-brand.

Your product uses a fully custom rendering pipeline that cannot integrate an npm package.

AI-generated email campaigns

Teams using React Email who want to generate email layouts and content from model output. The `@openuidev/react-email` package provides React Email component definitions and prompt options for model-generated emails.

You are not using React Email or do not need model-generated email content.

The problem

AI apps and agents can only respond with plain text by default, forcing developers to build custom rendering layers or accept low-fidelity chat responses when users need dashboards, forms, charts, and interactive interfaces. JSON-based UI generation formats exist but are verbose, slow to stream, and token-expensive, making them impractical for real-time use at scale.

How it works

OpenUI Lang

A compact, streaming-first language designed for model-generated UI. Each line defines one component such as `root = Stack([header, chart])`, so interfaces render while the model response is still streaming. Benchmarks show 52-67% fewer tokens than JSON-based formats across seven UI scenarios including tables, forms, dashboards, and e-commerce screens.

Framework-agnostic runtimes

First-party rendering packages for React, Vue, Svelte, and Angular let you adopt OpenUI inside the frontend stack you already use. A browser bundle ships for CDN, iframe, and no-build embed cases. React additionally gets prebuilt chat layouts and two built-in component libraries via `@openuidev/react-ui`.

Bring-your-own component library

Define which components the model is allowed to generate by registering your own design system. Supported out of the box: shadcn/ui, Material UI, Ant Design, Radix UI, Chakra UI, Mantine, and daisyUI. The CLI can generate a system prompt directly from your registered component set.

Works with existing agent frameworks

Dedicated packages for LangChain and LangGraph stream OpenUI through AG-UI without rewriting existing agent code. The `npx @openuidev/cli@latest setup-agent` command adds OpenUI instructions to AGENTS.md so Codex, Cursor, and Claude Code know how to build with it automatically.

OpenUI Gateway

A production reliability layer that catches and repairs invalid model output before it reaches users, switches providers automatically if one fails, and works with existing Chat Completions and Responses SDK calls. Uses your own model provider credentials so existing LLM spend and commitments carry over.

One-command scaffolding

Running `npx @openuidev/cli@latest create` scaffolds a working end-to-end app with streaming, built-in UI, OpenUI Lang support, and library-driven prompts. The CLI also handles agent setup and system prompt generation from a component library definition.

Features

  • OpenUI Lang
  • Framework-agnostic runtimes
  • Bring-your-own component library
  • Works with existing agent frameworks
  • OpenUI Gateway
  • One-command scaffolding

How to install

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

Recommended for this setup

Strengths

  • Significant token savings: Across seven representative UI scenarios, OpenUI Lang totaled 4,800 tokens versus 10,180 for Vercel json-render and 9,948 for Thesys C1 JSON, a 52-53% reduction. For a contact form specifically, the gap reached 67%. Fewer tokens means each generation finishes sooner and costs less.
  • No rewrite required: OpenUI integrates with Vercel AI SDK, LangChain, LangGraph, Convex, Cloudflare Workers, CrewAI, n8n, and Haystack through dedicated packages or a drop-in adapter. Existing agent logic stays intact; only the response rendering changes.
  • Broad model compatibility: Works with any model accessible via Chat Completions or Responses endpoints: OpenAI, Anthropic, Gemini, DeepSeek, xAI, Mistral, Qwen, and locally-running Ollama models. OpenUI Gateway can proxy across providers and switch automatically on failure.
  • Multi-platform rendering: The same OpenUI Lang output renders through React, Vue, Svelte, Angular, React Native, React Email for generated emails, and a plain script tag. The comparison table in the README shows this as a differentiator versus Vercel json-render (web, mobile, PDF, email, video) and A2UI (web, iOS, Android only).

Trade-offs

  • New language to learn: OpenUI Lang is not JSON and is not a standard like HTML or JSX. Teams must learn its syntax (`root = Stack([header, chart])`), understand component registration, and ensure their models reliably produce well-formed output. The Gateway helps repair invalid output, but there is still an additional abstraction layer to understand and debug.
  • React gets the most built-ins: Prebuilt chat layouts, two component libraries, headless chat state, and React Email support are React-only. Vue, Svelte, and Angular users get rendering runtimes but must bring more of their own UI layer. Projects heavily invested in non-React frameworks will find less ready-made tooling.
  • Production reliability depends on Gateway: Invalid model output repair, provider failover, and observability are features of OpenUI Gateway, which is a hosted Thesys service. Self-hosted or fully air-gapped deployments that cannot reach the Gateway service will need to handle output repair and failover themselves.

Tech stack

Languages
TypeScript, SCSS, JavaScript, CSS, Vue, Svelte
Frameworks
LangChain, Next.js, React
Databases
—
Tooling
—

FAQ

What is OpenUI Lang and how is it different from JSON?

OpenUI Lang is a compact, line-oriented language where each line defines one component, for example `root = Stack([header, chart])`. Unlike JSON, it is designed to stream progressively so the interface renders while the model is still writing its response. It uses up to 67% fewer tokens than JSON-based UI formats across the project's benchmarks.

Does OpenUI work with closed models like GPT-4o or Claude?

Yes. OpenUI works with any model accessible via Chat Completions or Responses endpoints, including OpenAI, Anthropic, Gemini, DeepSeek, xAI, Mistral, and Qwen. Locally-running Ollama models are also supported.

Can I use my existing component library?

Yes. You register the components you want the model to generate, then the CLI generates the system prompt from that set. shadcn/ui, Material UI, Ant Design, Radix UI, Chakra UI, Mantine, and daisyUI are documented as supported, and you can bring your own custom components.

What does OpenUI Gateway do and is it required?

Gateway is an optional production layer that repairs invalid model output before it reaches users, switches providers automatically on failure, and works with existing SDK calls. It is not required to use the core OpenUI framework, but the project recommends it for production deployments. It uses your own model provider credentials.

How do I set up a coding agent like Claude Code or Cursor to build with OpenUI?

Run `npx @openuidev/cli@latest setup-agent` in your project. This adds OpenUI instructions to AGENTS.md (or creates the file) so Codex, Cursor, Claude Code, and other coding agents know how to build with OpenUI. Projects scaffolded with `npx @openuidev/cli@latest create` already include these instructions.

Similar tools

More in AI Engineers