OpenUI SDK
API reference for the documented surfaces of @openuidev/react-lang, @openuidev/react-headless, @openuidev/react-ui, and @openuidev/react-email.
The OpenUI SDK is split into packages that build on each other:
-
@openuidev/react-lang— Core runtime. Define component libraries with Zod schemas, generate system prompts, parse OpenUI Lang, and render streamed output to React. This is the foundation — you need it for any OpenUI integration. -
@openuidev/react-headless— Headless chat state management. ProvidesChatProvider, thread/message hooks, streaming protocol adapters (OpenAI, AG-UI), and message format converters. Use this when you want full control over your chat UI. -
@openuidev/react-ui— Prebuilt chat layouts (Copilot,FullScreen,BottomTray) and two ready-to-use component libraries (general-purpose and chat-optimized). Depends on both packages above. Use this for the fastest path to a working chat interface. -
@openuidev/react-email— API reference for the pre-built email templates library and prompt options. -
@openuidev/cli— Command-line tool for scaffolding new OpenUI chat apps and generating system prompts or JSON schemas from library definitions.
Packages
@openuidev/react-lang
defineComponent, createLibrary, Renderer, parser APIs, action types, context hooks, and form validation.
@openuidev/react-headless
ChatProvider, useThread/useThreadList, stream protocol adapters (OpenAI, AG-UI), and message format converters.
@openuidev/react-ui
Copilot, FullScreen, BottomTray chat layouts, and two built-in component libraries (general-purpose and chat-optimized).
@openuidev/react-email
API reference for the pre-built email templates library and prompt options.
@openuidev/cli
openui create (scaffold a Next.js app) and openui generate (system prompt / JSON schema from a library definition).