All integrations

React Native

Render model-generated interfaces in a native mobile chat application with a dedicated component library.

How it connects to OpenUI

The reference project pairs a React Native chat app with a backend that prompts for OpenUI Lang. Native component definitions map the same structured response model to mobile views and actions.

Integration steps

  1. 1

    Describe the components on the backend

    Define the component vocabulary (Card, Text, and chart components) with defineComponent and createLibrary in a Node-compatible file, with renderers set to null. The CLI compiles it into the system prompt.

  2. 2

    Stream plain text

    Return raw text/plain chunks from the chat route instead of SSE, so the mobile app can read the stream without a browser EventSource.

  3. 3

    Render native components

    Use Renderer from @openuidev/react-lang in the Expo app with a library that maps the same component names to native views and charts.