Mental Model
The conceptual model behind ToonUI: server teaches, model describes, client renders, app decides.
ToonUI is a contract between your model and your app.
server teaches -> model describes -> client renders -> app decidesIt is not an alternative to JSON renderers like json-render.dev. ToonUI does not try to turn arbitrary JSON into a screen. It teaches the model a small semantic language, validates that language against your active catalog, and lets your app render known components.
Ownership
| Layer | Owner |
|---|---|
| Active catalog and prompt | @toon-ui/core |
| Model response generation | your AI SDK/model provider |
| React rendering | @toon-ui/react |
| Business behavior | your app |
Important rule
The model does not create new components.
It can only emit standard ToonUI components enabled in the active catalog.
createToonProtocol({
components: ['text', 'card', 'button'],
});That prompt will not teach form, table, or chart unless you enable them.
Interactions are intent, not execution
A button like this:
button primary "Delete" reply="delete product 123"is not a deletion.
It is user intent. Your app decides whether to call a tool, ask for confirmation, check permissions, or ignore it.