How it connects to OpenUI
@lynx-js/genui/openui incrementally parses OpenUI Lang, maps registered expressions to ReactLynx components, and renders them through Lynx's native pipeline while the host application owns its component definitions, tools, and actions.
Start here
Install or scaffold
npm install @lynx-js/genui @lynx-js/react @lynx-js/lynx-uiIntegration steps
- 1
Create the library
Build a component library with createOpenUiLibrary() from @lynx-js/genui/openui, and import the renderer stylesheet from @lynx-js/genui/openui/styles/renderer.css.
- 2
Generate the agent instructions
On the server, build the system prompt with buildOpenUiSystemPrompt() from @lynx-js/genui/openui/prompt.
- 3
Render with OpenUiRenderer
Pass the full text received so far, not just the latest delta, to OpenUiRenderer with the library. Handle host-side effects such as navigation in onAction.