How vercel-labs/json-render works
json-render is a guardrailed generative-UI framework and documentation playground. A developer defines a catalog and an application requests a UI from a prompt; the web API builds catalog-constrained prompts, streams model output, and the playground progressively renders the resulting spec. Core schemas, validation, state, actions, and directives support predictable runtime behavior, while framework adapters render the same model across platforms. The tree and sampled files confirm the web generation, docs, MCP, and several adapters; some listed README integrations are represented only at their documented package paths.
Main entry points: route.ts Generation API · page.tsx Playground UI · renderer.tsx React Renderer · server.ts MCP App Server
Components 23
Generation and Docs
- Playground UI
apps/web/app/playground/page.tsx - Generation API
apps/web/app/api/generate/route.ts - Docs Chat API
apps/web/app/api/docs-chat/route.ts - Docs Search API
apps/web/app/api/search/route.ts - Docs Markdown API
apps/web/app/api/docs-markdown/route.ts - Search Index
apps/web/lib/search-index.ts
Core Runtime
- Playground Catalog
apps/web/lib/render/catalog.ts - Spec Schema
packages/core/src/schema.ts - Prompt Builder
packages/core/src/prompt.ts - Spec Validation
packages/core/src/validation.ts - State and Actions
packages/core/src/state-store.ts
Platform Renderers
- React Renderer
packages/react/src/renderer.tsx - Svelte Renderer
packages/svelte/src/renderer.ts - Platform Adapters
packages/next/src/index.ts - Media Renderers
packages/remotion/src/server.ts
Integrations and Tools
- MCP App Server
packages/mcp/src/server.ts - UI Codegen
packages/codegen/src/index.ts - Runtime Devtools
packages/devtools/src/index.ts - Dynamic Directives
packages/directives/src/index.ts
Other components
- Application Developer
- UI User
- AI Model
- MCP Host
Connections 26
- Application Developer → Playground UI: defines catalog
- UI User → Playground UI: enters prompt
- Playground UI → Generation API: requests generation
- Generation API → Playground Catalog: reads catalog
- Generation API → Prompt Builder: builds prompt
- Generation API → AI Model: streams request
- Generation API → Playground UI: streams spec
- Playground UI → React Renderer: renders spec
- React Renderer → State and Actions: binds state
- React Renderer → Spec Validation: validates interactions
- Prompt Builder → Spec Schema: uses schema
- Playground Catalog → Spec Schema: defines components
- Docs Chat API → AI Model: streams answers
- UI User → Docs Chat API: asks question
- UI User → Docs Search API: searches docs
- Docs Search API → Search Index: queries index
- UI User → Docs Markdown API: requests markdown
- MCP Host → MCP App Server: invokes tool
- MCP App Server → Spec Validation: validates spec
- MCP App Server → React Renderer: serves UI resource
- Application Developer → Svelte Renderer: chooses adapter
- Application Developer → Platform Adapters: chooses adapter
- Application Developer → Media Renderers: chooses output
- Application Developer → UI Codegen: generates code
- Application Developer → Runtime Devtools: inspects runtime
- State and Actions → Dynamic Directives: resolves values