Live data from Hacker News

I turned Markdown into a protocol for generative UI

fabian-kuebler.com

11–20 of 72 posts

Re: I turned Markdown into a protocol for generative UI

#11

OpenUI and JSON-render are some other players in this space. I’m building an agentic commerce chat that uses MCP-UI and want to start using these new implementations instead of MCP-UI but can’t wrap my head around how button on click and actions work? MCP-UI allows onClick events to work since you’re “hard coding” the UI from the get-go vs relying on AI generating undertemistic JSON and turning that into UI that migh…

In my approach, callbacks are first-class. The agent defines server-side functions and passes them to the UI:

  const onRefresh = async () => {
    data.loading = true;
    data.messages = await loadMessages();
    data.loading = false;
  };

  mount({
    data,
    callbacks: { onRefresh },
    ui: ({ data, callbacks }) => (
      Refresh
    )
  });
When the user clicks the button, it invokes the server-side function. The callback fetches fresh data, updates state via reactive proxies, and the UI reflects it — all without triggering a new LLM turn.

So the UI is generated dynamically by the LLM, but the interactions are real server-side code, not just display. Forms work the same way — "await form.result" pauses execution until the user submits.

The article has a full walkthrough of the four data flow patterns (forms, live updates, streaming data, callbacks) with demos.

Re: I turned Markdown into a protocol for generative UI

#12

There’s definitely a lot of merit to this idea, and the gifs in the article look impressive. My strong opinion is that there’s a lot more to (good) UIs than what an LLM will ever be able to bring (happy to be proven wrong in a few years…), but for utilitarian and on-the-fly UIs there’s definitely a lot of promise

Thanks! I totally agree — this isn't about replacing carefully designed UIs. It's about ephemeral interfaces you need in the moment — the throwaway dashboard for this specific dataset, the one-off form for this exact workflow. Things that would normally mean opening 3 different apps.

Re: I turned Markdown into a protocol for generative UI

#13
post #4

If you're still looking for a name let me suggest "hyper text". It embodies the whole idea of having data, code and presentation at the same place. If you're open for contributions I already have an idea for cascading styles system in mind.

Ha, history does rhyme ;) Happy if you reach out via mail!

Re: I turned Markdown into a protocol for generative UI

#17
post #4

If you're still looking for a name let me suggest "hyper text". It embodies the whole idea of having data, code and presentation at the same place. If you're open for contributions I already have an idea for cascading styles system in mind.

Ha, history does rhyme ;) Happy if you reach out via mail!

I think he's talking about CSS

Re: I turned Markdown into a protocol for generative UI

#18
post #4

If you're still looking for a name let me suggest "hyper text". It embodies the whole idea of having data, code and presentation at the same place. If you're open for contributions I already have an idea for cascading styles system in mind.

If HTML happened again except this time it was markdown, maybe more non-nerds would be able to use it? XML just looks gnarly.

Re: I turned Markdown into a protocol for generative UI

#19
post #5
post #4

If you're still looking for a name let me suggest "hyper text". It embodies the whole idea of having data, code and presentation at the same place. If you're open for contributions I already have an idea for cascading styles system in mind.

Every turn of the wheel someone wants to make a new one. Maybe one day someone will invent a rounder wheel.

Personally I think we should move to heptagons, they're round enough.

The wheel is what I would call, passé.

Re: I turned Markdown into a protocol for generative UI

#20
I quite like this! I've been incrementally building similar tooling for a project I've been working on, and I really appreciate the ideas here.

I think the key decision for someone implementing a flexible UI system like this is the required level of expressiveness. To me, the chief problem with having agents build custom html pages (as another comment suggested) is far too unconstrained. I've been working with a system of pre-registered blocks and callbacks that are very constrained. I quite like this as a middleground, though it may still be too dynamic for my use case. Will explore a bit more!

Post reply on HN