Generative UI · Structured Outputs

Day One

I built a personal onboarding experiment that turns a written request into an interactive screen. It is separate from my Microsoft employer work.

6 generative components Structured-output rendering Next.js · React · TypeScript Live demo
At a glance 30-second read

What it is

I built an onboarding interface that assembles screens from six reusable components. A person writes a request, Claude returns a structured description, and the app checks it before displaying the interface. This personal project is separate from the Microsoft onboarding work.

What I explored

I explored how a written request could become a guided, interactive screen.

Skills and tools

  • Generative UI architecture (LLM → JSON → React render)
  • Structured-output prompt design
  • Component library designed for assembly, not pages
  • Next.js streaming + interactive component handoff
  • Plain-language input → governed UI surface
Next.js React TypeScript Anthropic SDK Structured Output Generative UI
See it run one take, no narration

Type a sentence. Get an interface.

One pass: a plain-language onboarding request, a structured UI spec from Claude, and an interactive interface rendered from it. The screens are assembled at request time, not hardcoded.

day-one · new-hire onboarding [ RECORDED RUN ]

A recorded run through the sample prompts. Each one assembles a different interface, and every component is interactive. Open the live demo → to try it yourself.

What it is
Person New hire asks in plain language
→
AI Claude Sonnet returns a UI spec
→
This project day one the render layer
→
Output A real interface built from structured data

The model does not return a chat reply. It returns a typed list of UI blocks; the app validates them with Zod and mounts the interactive components. The interface is generated, not hardcoded.

6
block types
5
precomputed prompts
1
Zod schema gate
0
hardcoded screens
01 — The Components six blocks the model can assemble

A vocabulary of UI.

The model does not draw pixels. It picks from a fixed set of interactive components and fills their props. Six block types cover a new hire's first week.

Profile Wizard
multi-step form
A guided setup form — basics, role, logistics — with step progress and a final summary panel.
Block · profile_wizard
Progress Ring
completion meter
An onboarding-completion ring. Tap a task and it advances; the ring recomputes in place.
Block · progress_ring
Benefits Selector
plan picker
Pickable plan cards with a live cost summary that updates as the new hire chooses.
Block · benefits_selector
Equipment Checklist
IT & access setup
A checkable IT-and-access list with a running "ready" counter and per-item owners.
Block · equipment_checklist
Team Card
your people
Manager, teammates, and an expandable note on where the team sits in the org.
Block · team_card
Schedule Timeline
first week
Day tabs over a per-day event timeline, with an add-to-calendar toggle on each event.
Block · schedule_timeline
02 — The Mechanism structured output, not free text

The model returns a UI spec.

Claude is forced to call one tool. Its argument is the UI spec — an ordered, typed list of blocks. This is what comes back from the request "what does my first week look like?"

render_onboarding_ui · tool call [ STRUCTURED OUTPUT ]
{
"intent": "First-week schedule",
"summary": "Here's how your week is shaped…",
"blocks": [
{ "type": "schedule_timeline", "props": { … } },
{ "type": "progress_ring", "props": { … } }
]
}

Tool-use forcing guarantees the envelope. A Zod discriminated union validates every block's props before a single component mounts — an invalid block never reaches the screen. The renderer switches on type and mounts the matching React component.

03 — Generative UI the data drives the interface

The UI is generative.

No screen in this app is hardcoded. Every interface a visitor sees is rendered from a structured spec; change the request, and the UI changes with it.

Generative, not hardcoded
The screen is a render of the model's JSON. New request, new blocks, new UI — with no interface code changed.
Schema-validated
Tool-use forces the shape; a Zod discriminated union enforces the contract. The envelope and the props are both validated.
Two demo modes
Five precomputed prompts render instantly with no key; bring an Anthropic key to generate UI live from any request.