Generative AI is rapidly transforming the landscape of user interface (UI) design. No longer limited to simple text-based interactions, Generative UI, as it is now known, encompasses a wide range of applications that leverage Large Language Models (LLMs) to create more dynamic and responsive user experiences.
Generative UI represents a paradigm shift in UI development, moving away from static, pre-defined interfaces towards more dynamic and personalized experiences. It can be envisioned as a spectrum, with simple text-based interactions at one end and the generation of entire web pages or applications at the other.

While the ultimate goal might be to have LLMs generate fully functional UIs on demand, this vision faces significant challenges in terms of performance and reliability. Currently, it takes around 5-7 seconds for an LLM to generate a simple HTML page, which is far too slow for today's web performance standards. Moreover, the non-deterministic nature of LLMs makes it difficult to guarantee the safety and reliability of the generated code.
Instead of aiming for complete UI generation, a more practical approach is to leverage LLMs for generating data that can then be used to populate existing UI components. This is where structured output becomes crucial.
Modern LLMs have the remarkable ability to generate responses not just as free-form text, but also in predefined formats. This structured output is achieved by providing the LLM with a schema that defines the desired structure of the data.
Using schemas offers several advantages:
.png)
One challenge inherent in using LLMs for UI development is their streaming nature. As the LLM generates the data token by token, the UI might experience flickering or excessive re-rendering, leading to a suboptimal user experience.