Dayward AIWeChat Mini Program
Frontend Agent UX in 7 Days: From Streaming to Generative UI
Week 1 · D5🔒 LockedAbout 4 hours

Three Paradigms of Generative UI: From Component Mapping to Declarative Interfaces

There are three ways to let an agent decide what the interface looks like, handing control progressively from the frontend to the model. Implement all three, focusing on their security boundaries and why the most flexible one is usually the most dangerous in production.

Today's goals 0/3

Sign in to tick these off and save your progress.

Today's Goals

  1. Distinguish the three generative UI paradigms and rank them by control versus freedom
  2. Implement a component registry with a fallback so an unexpected type does not break the interface
  3. Explain the risks of open-ended generation and give a clear production recommendation

Yesterday's shared state was really the precursor to this: once the data is decided by the model, the natural next question is whether the components rendering it can be too. When you finish, scroll back up and tick the three goals off.

Plain-Language Walkthrough

From choosing to generating: how much of the interface does the model decide?

Interpreters normally just speak. But imagine a stronger version: they can press a button and put a table, a poll, or a chart on the conference's main screen.

That raises a permissions question: what exactly are they allowed to put up there?

  • Version one: the screen has ten preset templates, and the interpreter picks one and fills it in
  • Version two: the interpreter describes "title on the left, three badges on the right" and a technician renders it to the venue's standards
  • Version three: the interpreter can project anything at all, including programs they wrote themselves

Freedom rises, control falls. The three generative UI paradigms map onto this exactly.

Sign in and link WeChat to read

Sign in, then link your WeChat mini program account on the account page. Linked accounts share one free article per day. Unlock additional articles with rewarded videos in the mini program.

Mini program QR code

Scan in WeChat to open Dayward AI. Open the same course and chapter, choose the rewarded video, then refresh this page after completion.

Interview questions

  • How much control do the three generative UI paradigms hand to the model, and which would you choose in production?生成式界面的三种范式分别把多少控制权交给模型?你在生产里会选哪种?
    Common in ChinaCommon overseasIntermediate#generative-ui#architecture#decision-making

    🔒 Unlock this chapter to see the answer keys.

  • The model returns a component type you never registered. How should the interface handle it?模型返回了一个你没注册过的组件类型,界面应该怎么处理?
    Common in ChinaCommon overseasIntermediate#generative-ui#error-handling#resilience

    🔒 Unlock this chapter to see the answer keys.

  • What are the risks of having a model generate frontend code that runs in the user's browser, and how would you bound them?让模型直接生成前端代码并在用户浏览器里执行,有哪些风险?你会怎么设边界?
    Common in ChinaCommon overseasDeep dive#security#generative-ui#prompt-injection

    🔒 Unlock this chapter to see the answer keys.

  • Structured output also streams. How should the interface render a JSON payload that is only half complete?结构化输出也是流式生成的,界面在 JSON 只到一半时应该怎么渲染?
    Common in ChinaCommon overseasIntermediate#streaming#generative-ui#ui-state

    🔒 Unlock this chapter to see the answer keys.

Comments