# OpenUI (Thesys)

> An open standard and React runtime for streaming model-generated UI

- Category: App UIs & Builders / Generative UI SDKs
- Language: TypeScript
- Licence: MIT
- Repository: https://github.com/thesysdev/openui
- Website: https://thesys.dev
- Canonical page: https://ai-tldr.dev/tools/openui-thesys/

## In short

OpenUI (Thesys) is a full-stack framework for generative UI. At its center is OpenUI Lang, a compact streaming-first language that lets a model emit structured UI such as charts, forms, tables, and cards instead of plain text. It sits in the Generative UI SDKs category of the App UIs & Builders tools and is open-source, written in TypeScript and licensed MIT.

## Overview

OpenUI (Thesys) is a full-stack framework for generative UI. At its center is OpenUI Lang, a compact streaming-first language that lets a model emit structured UI such as charts, forms, tables, and cards instead of plain text. The project pairs this language with a React runtime, built-in component libraries, and ready-made chat interfaces.

It is aimed at developers building assistants, copilots, and interactive product flows where the model needs to return real UI rather than text the app has to parse by hand. You define which components the model is allowed to use, generate a system prompt from that library, and render the streamed output progressively as tokens arrive.

Within the generative UI space, OpenUI fits as both a standard and a runtime. The core parser and prompt generation live in a framework-agnostic package, with separate bindings for React, Vue, and Svelte, so you can adopt it at the level that matches your stack.

## What it does

- OpenUI Lang: a compact, streaming-first language for structured UI generation, described as up to 67% more token-efficient than JSON
- Built-in component libraries for charts, forms, tables, and layouts that you can use directly or extend
- Prompt generation from your own component library, so model instructions reflect only the components you allow
- Streaming renderer that parses and renders model output progressively in React as tokens stream in
- Ready-to-use chat and app surfaces for assistants, copilots, and broader interactive flows
- Framework bindings beyond React, including Vue 3 and Svelte 5 packages, plus a browser bundle for no-build embeds

## Getting started

The fastest way to start is the CLI scaffolder, which generates an end-to-end app with streaming, built-in UI, and OpenUI Lang support already wired up.

1. Scaffold a new app

   Use the OpenUI CLI to create a generative chat app and move into the new directory.

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

2. Add your model API key

   Create a .env file with your OpenAI API key so the app can call a model.

```bash
echo "OPENAI_API_KEY=sk-your-key-here" > .env
```

3. Run the dev server

   Start the scaffolded app, which gives you a ready-to-run example with streaming and built-in components.

```bash
npm run dev
```

## When to use it

- Build an AI assistant or copilot that returns interactive charts, forms, and tables instead of plain text
- Add a chat surface to a product where the model drives real UI you control via an allowed component set
- Stream model-generated UI progressively so users see results render as tokens arrive
- Generate model-renderable interfaces in React, Vue, or Svelte from a shared component library and prompt layer
