Skip to content

« all projects

gen ui demo

2026 · live · 2-day prototype · solo

Two Claude tool-use calls in series. Stage 1 picks components from a tiny web-component library and fills them with content. Stage 2 arranges them into a layout. The renderer is plain Svelte. The LLM never writes code.


try it

Pick a starter prompt or write your own. Currently running on mocks — full Anthropic wiring lands next.

Or try:

how it works

Stage 1 — content + component selection
Anthropic Messages API call with a tool schema describing each component (name, description, prop types). The model returns its choices as tool_use blocks. The app parses them into a flat array of { component, props } pairs. The model never returns JSX, HTML, or CSS.
Stage 2 — layout decision
Second Messages API call. The component array from Stage 1 is the input. The tool schema defines a recursive grid layout (type, columns, children, span). Output is a single layout object referencing components by index.
Stage 3 — deterministic render
A recursive Svelte component walks the layout JSON and renders each web component with its filled props. Plain application code. No LLM involvement. Predictable, testable, debuggable.

what this proved


stack

Frontend
Astro, Svelte 5, Lit web components
Pipeline
Anthropic Messages API, two-stage tool use, async generator stream
Hosting
Cloudflare Pages + Pages Functions
Original prototype
Svelte, Node.js, AWS Bedrock with Claude tool use

Full write-up: Generating UI Without Generating Code · source on github