Define a catalog. AI generates JSON. Your components render natively.
Specify which components AI can use with Zod schemas. Full type safety and validation.
Map catalog types to your React components. Use your own design system.
AI outputs JSON matching your schema. Stream it. Render progressively.
Components, actions, and validation functions. All type-safe with Zod.
{`import { createCatalog } from '@json-render/core';
import { z } from 'zod';
export const catalog = createCatalog({
components: {
Card: {
props: z.object({
title: z.string(),
description: z.string().nullable(),
}),
hasChildren: true,
},
Metric: {
props: z.object({
label: z.string(),
valuePath: z.string(),
format: z.enum(['currency', 'percent']),
}),
},
},
actions: {
export: { params: z.object({ format: z.string() }) },
},
});`}
Constrained output that your components render natively.
{`{
"key": "dashboard",
"type": "Card",
"props": {
"title": "Revenue Dashboard",
"description": null
},
"children": [
{
"key": "revenue",
"type": "Metric",
"props": {
"label": "Total Revenue",
"valuePath": "/metrics/revenue",
"format": "currency"
}
}
]
}`}
{feature.desc}
npm install @json-render/core @json-render/react