JSON Render: Build AI UIs with a Schema
If you've ever built an interface for an AI feature, you know the drill. You call an API, get back a blob of JSON, and then write a bunch of React components to parse it and render something useful. It's repetitive work that feels like it should be automated. What if the UI could just... build itself based on the data?
That's the idea behind JSON Render, an open-source schema-driven UI rendering engine from Vercel Labs. It takes a structured JSON schema and automatically generates a corresponding React interface. It turns a data definition into a live UI, which is incredibly handy for quickly prototyping AI-driven applications where the output format is known but the rendering logic is boilerplate.
What It Does
In simple terms, JSON Render is a React library that consumes a JSON schema and a corresponding data object. It uses that schema to understand the type, structure, and intent of the data, and then automatically renders the appropriate UI components.
You define what your data looks like (e.g., an object with a title string and a status enum), and JSON Render figures out how to display it (e.g., a text heading and a dropdown selector). It comes with a built-in set of renderers for common types like strings, numbers, booleans, enums, arrays, and objects.
Why It's Cool
The clever part is how it leverages schema intent. A string with a format of "date-time" can render as a date picker. An array of objects becomes a sortable table. This declarative approach means your UI is tightly coupled to your data contract, which is perfect for AI applications where the LLM's output is structured according to a specific schema (like with OpenAI's function calling or structured outputs).
It's also highly extensible. Don't like the default component for a boolean? Swap it out. Need a custom renderer for a special "color" format? You can add it. This makes it a powerful foundation rather than just a rigid, off-the-shelf solution.
For developers, the immediate use case is speed. You can go from a validated data schema to a functional admin panel, settings page, or AI output viewer in minutes. It's particularly useful for internal tools, prototyping, or any situation where you need to build a UI for structured, schema-defined data on the fly.
How to Try It
The easiest way to see it in action is to check out the live demo. You can play with different schemas and see the UI update in real time: Open the JSON Render Live Demo
To use it in your own project, install it from npm:
npm install @vercel-labs/json-render
Here's a quick example of how you might use it:
import { JsonRender } from '@vercel-labs/json-render';
const schema = {
type: 'object',
properties: {
name: { type: 'string', title: 'Full Name' },
active: { type: 'boolean', title: 'Is Active' },
},
};
const data = {
name: 'Jane Doe',
active: true,
};
function MyComponent() {
return <JsonRender schema={schema} data={data} />;
}
Head over to the JSON Render GitHub repository for full documentation, more examples, and the source code.
Final Thoughts
JSON Render feels like one of those tools that solves a specific, recurring pain point really well. It won't replace your entire component library, but for generating dynamic UIs from known data structures—especially in the world of AI—it's a massive shortcut. It cuts out the middle layer of tedious component mapping and lets you focus on the schema and the logic. If you're building anything where the interface needs to adapt to structured data, it's definitely worth a look. It’s a pragmatic solution that embodies the "write less code" philosophy in a genuinely useful way.
Follow us for more interesting projects: @githubprojects
Repository: https://github.com/vercel-labs/json-render