Scripts2026年7月3日·1 分钟阅读

JSON Render — The Generative UI Framework by Vercel

A framework for rendering dynamic, interactive UI components from JSON schemas generated by LLMs. Build generative user interfaces that adapt to AI outputs in real time.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
JSON Render
直接安装命令
npx -y tokrepo@latest install b083378d-771d-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

JSON Render is a framework from Vercel Labs that bridges LLM outputs and interactive UI. Instead of returning plain text, an LLM produces a JSON schema describing a component tree, and JSON Render turns that schema into fully interactive React components on the client.

What JSON Render Does

  • Renders interactive React components from JSON schemas produced by LLMs
  • Maps schema nodes to your own component library for consistent design
  • Handles nested layouts, event handlers, and dynamic data binding
  • Supports streaming schemas so the UI builds progressively as the LLM generates
  • Provides a type-safe component registry for mapping schema keys to React components

Architecture Overview

The framework operates as a rendering layer between an LLM backend and a React frontend. The LLM generates structured JSON describing the desired UI (component types, props, children, layout). JSON Render walks this tree, resolves each node against a developer-defined component map, and renders the result as a live React tree. Streaming mode allows partial schemas to render incrementally.

Self-Hosting & Configuration

  • Install via npm and add to any React or Next.js project
  • Define a component map linking schema keys to your React components
  • Configure the LLM prompt to output the expected JSON schema format
  • Works with any LLM provider that supports structured output (OpenAI, Anthropic, etc.)
  • No additional backend infrastructure required beyond your existing LLM API

Key Features

  • Decouples UI rendering from LLM logic so models describe intent, not code
  • Streaming support renders UI progressively as tokens arrive
  • Type-safe component registry prevents runtime mismatches
  • Works with any React component library (shadcn/ui, Material UI, custom)
  • Lightweight with no heavy runtime dependencies

Comparison with Similar Tools

  • Vercel AI SDK — general AI streaming vs. dedicated generative UI rendering
  • Streamlit — Python-first data apps vs. React-first generative interfaces
  • Gradio — ML demo builder vs. production-grade component rendering from schemas
  • Chainlit — chat-focused AI UI vs. arbitrary component tree generation

FAQ

Q: Do I need to use Next.js? A: No. JSON Render works with any React application, though it integrates well with Next.js and the Vercel AI SDK.

Q: Can the LLM generate arbitrary HTML? A: No. The LLM generates JSON schemas that map to your pre-registered components, which prevents injection risks and ensures design consistency.

Q: Does it support non-React frameworks? A: Currently React is the primary target. Community adapters for other frameworks may emerge.

Q: How do I handle user interactions in generated UIs? A: Components in your registry can include event handlers. The schema can reference handler keys that your app resolves at render time.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产