Shaf Lab

Generative UI

User interfaces assembled on the fly by a model from a set of components.

Generative UI is an interface assembled on the fly by a model from a set of components, instead of a fixed screen designed in advance. The model chooses which blocks to show, how to fill them, and sometimes how to sequence them, given a user goal and a catalog it is allowed to use. It is not the same as generating raw HTML from a prompt and hoping the page holds together.

The catalog is the product. Each component should have a clear name, a schema for its props, and visual rules that still look right when they are combined in unusual orders. Affordances have to stay honest: a button the model places must do what it looks like it does. If the model can invent a new control, you will spend the rest of the week chasing layout bugs.

Always have a fallback layout for when generation fails or is slow. Cache stable generations when the same goal comes back. Log the component tree the model produced so you can reproduce a broken page.

Use generative UI where the screen should change with the task, such as a dashboard or a results view. For a settings form or a checkout, a designed, tested layout is usually the better choice.