█

AI/TLDR

मुझे पिलाएं कॉफ़ी
मुझे एक कॉफ़ी पिलाएँ

json-render

मॉडल से कॉम्पोनेंट नहीं, JSON लिखवाएं, और उसे अपने ख़ुद के UI में रेंडर करें

Generative UI SDKsओपन सोर्स
ताज़ा
v0.21.0
अपडेट किया गया
18 सित॰ 2026
भाषा
TypeScript
लाइसेंस
Apache-2.0
कवरेज
1 story

नया क्या है

v0.21.018 सित॰ 2026

Added @json-render/tanstack-start, a renderer for JSON-defined applications with file-based routes, reusable layouts, SSR loaders, head metadata, prerender paths, client navigation and route fallbacks. Also added experimental spec composition (experimental_composeSpec and experimental_createEvaluator), catalog-declared named slots for Vue registries, and stabilized streamed React renders.

ताज़ा खबरें

संक्षेप में

json-render क्या है?

json-render मॉडल से कॉम्पोनेंट नहीं, JSON लिखवाएं, और उसे अपने ख़ुद के UI में रेंडर करें. यह App UIs & Builders टूल्स की Generative UI SDKs श्रेणी में आता है; ओपन सोर्स है, TypeScript में लिखा गया है और Apache-2.0 लाइसेंस के तहत है। शुरू करने के लिए: इंस्टॉल करें.

अपडेट किया गया Markdown वर्शन ↗

सारांश

json-render, Vercel Labs का एक ओपन सोर्स फ्रेमवर्क है जो generative UI के लिए बना है। इसमें मॉडल से कॉम्पोनेंट कोड लिखवाने के बजाय आप उससे ऐसा JSON मँगवाते हैं जो सिर्फ़ उन कॉम्पोनेंट्स का वर्णन कर सके जिन्हें आप पहले ही ship कर चुके हैं। प्रोजेक्ट जो वर्कफ़्लो बताता है वह है AI, फिर json-render, फिर UI। डेवलपर अनुमति वाले कॉम्पोनेंट्स और actions की एक catalog परिभाषित करता है; मॉडल उस catalog तक सीमित एक JSON spec बनाता है; json-render उस spec को असली implementations से जोड़ देता है। जो generation catalog में फ़िट नहीं होता, वह अनपेक्षित कुछ रेंडर करने के बजाय validation में फेल हो जाता है।

यह फ्रेमवर्क एक core पैकेज और हर rendering target के लिए अलग पैकेज में बँटा है। @json-render/core में schemas, catalogs, AI prompts और expression evaluation होते हैं, जबकि renderers web (React, Vue 3, Svelte 5, SolidJS), mobile (React Native), documents (react-pdf के ज़रिए PDF, react-email के ज़रिए email), video (Remotion), 3D (React Three Fiber), terminal UIs (Ink) और पूरे applications (Next.js और, 0.21.0 से, TanStack Start) को कवर करते हैं। एक साथी पैकेज @json-render/shadcn 36 pre-built shadcn/ui components देता है, ताकि catalog पहले ही दिन से काम की हो।

Specs सिर्फ़ स्थिर markup भर नहीं हैं। Props { "$state": "/user/name" } या { "$computed": "functionName" } जैसे expressions के ज़रिए application state का रेफ़रेंस ले सकते हैं; elements state की शर्तों पर दिखाए या छिपाए जा सकते हैं; setState actions state model को अपडेट करते हैं और उस पर निर्भर हर चीज़ को फिर से evaluate करते हैं; और state watchers बदलाव होने पर custom actions चला सकते हैं। SpecStream utilities मॉडल के जवाब को stream होने के साथ-साथ progressively रेंडर करती हैं, ताकि इंटरफ़ेस एक साथ आने के बजाय धीरे-धीरे भरता जाए।

यह क्या करता है

  • Catalog-constrained generation: defineCatalog उन कॉम्पोनेंट्स और actions को declare करता है जिन्हें मॉडल इस्तेमाल कर सकता है, Zod prop schemas के साथ, ताकि गलत आउटपुट रेंडर होने के बजाय validation में फेल हो
  • एक spec, कई targets: React, Vue 3, Svelte 5, SolidJS, React Native, React Three Fiber, Remotion video, PDF, email, HTML, Ink terminal UIs, Next.js और TanStack Start के लिए renderers
  • Data binding और state: props $state और $computed expressions से state का रेफ़रेंस ले सकते हैं, साथ में conditional visibility, setState actions और state watchers जो custom व्यवहार ट्रिगर करते हैं
  • Progressive rendering: SpecStream मॉडल के stream होने के साथ ही spec रेंडर करता है, पूरे जवाब का इंतज़ार किए बिना
  • Directives: तारीख़ फ़ॉर्मैटिंग, math, string manipulation और इंटरनैशनलाइज़ेशन के लिए तैयार utilities, साथ में अपने JSON shapes के लिए custom directives API
  • @json-render/shadcn के ज़रिए 36 pre-built shadcn/ui components, और React, Vue, Svelte व Solid के लिए devtools panels जो रेंडर हुए DOM को वापस spec keys से मैप करते हैं

शुरू करें

core पैकेज के साथ वह renderer इंस्टॉल करें जो आपको चाहिए, एक catalog परिभाषित करें, उसके पीछे के कॉम्पोनेंट्स implement करें, फिर मॉडल द्वारा बनाए spec को रेंडर करें।

इंस्टॉल करें

Core पैकेज और एक renderer। shadcn पैकेज वैकल्पिक है और 36 तैयार components देता है।

bashbash
# React with shadcn/ui components
npm install @json-render/core @json-render/react @json-render/shadcn

# Full Next.js apps
npm install @json-render/core @json-render/react @json-render/next

# Mobile
npm install @json-render/core @json-render/react-native

Catalog परिभाषित करें

Catalog मॉडल के साथ एक contract है: इसमें वे सभी components सूचीबद्ध होते हैं जिन्हें मॉडल इस्तेमाल कर सकता है, props के लिए Zod schema और मॉडल के पढ़ने वाला विवरण के साथ।

typescripttypescript
import { defineCatalog } from "@json-render/core";
import { z } from "zod";

const catalog = defineCatalog(schema, {
  components: {
    Card: {
      props: z.object({ title: z.string() }),
      description: "A card container",
    },
    Button: {
      props: z.object({ label: z.string() }),
      description: "Clickable button",
    },
  },
});

Components implement करें

defineRegistry हर catalog entry को एक असली implementation से जोड़ता है। Components props और children प्राप्त करते हैं, और catalog में घोषित actions चलाने के लिए emit को कॉल करते हैं।

tsxtsx
const { registry } = defineRegistry(catalog, {
  components: {
    Card: ({ props, children }) => (
      <div className="card">
        <h3>{props.title}</h3>
        {children}
      </div>
    ),
    Button: ({ props, emit }) => (
      <button onClick={() => emit("press")}>{props.label}</button>
    ),
  },
});

मॉडल का spec रेंडर करें

मॉडल का बनाया JSON और registry renderer को दें। Catalog के बाहर की कोई चीज़ स्क्रीन तक नहीं पहुँच सकती।

tsxtsx
<Renderer spec={spec} registry={registry} />

कमांड और कोड प्रोजेक्ट के अपने दस्तावेज़ों से लिए गए हैं — हमेशा जांचें आधिकारिक repo ताज़ा जानकारी के लिए।

कब इस्तेमाल करें

  • ऐसा chat या agent surface बनाएं जहाँ जवाब markdown के बजाय असली charts, forms, tables और cards के रूप में आएँ
  • निजीकृत dashboards और onboarding flows भेजें, जिन्हें मॉडल हर user के लिए उन components से जोड़ता है जो आपके design system में पहले से हैं
  • एक ही spec को अलग-अलग targets में बनाएं, जैसे web page, PDF report और email, बिना layout दोबारा लिखे
  • Next.js या TanStack Start renderers का इस्तेमाल करके file-based routes और server rendering के साथ पूरे routed applications एक spec से खड़े करें

How json-render compares

json-render alongside other open-source generative ui sdks tools AI/TLDR tracks, ranked by GitHub stars.

टूलस्टारयह क्या करता है
CopilotKit★ 39.1kइन-ऐप AI copilots और agent-driven generative UI को React और उससे आगे तक जोड़ें
Vercel AI SDK★ 28.3kProvider-agnostic TypeScript टूलकिट, AI ऐप्स, agents और chat UI बनाने के लिए
OpenUI★ 22.8kसादे शब्दों में UI का वर्णन करें और LLM को उसे लाइव रेंडर होते देखें
AG-UI प्रोटोकॉल★ 22.5kAI एजेंट को यूज़र-फेसिंग ऐप्स से जोड़ने वाला एक ओपन, इवेंट-आधारित प्रोटोकॉल
json-render★ 19.9kमॉडल से कॉम्पोनेंट नहीं, JSON लिखवाएं, और उसे अपने ख़ुद के UI में रेंडर करें
A2UI★ 19.2kएजेंट्स के लिए एक ओपन प्रोटोकॉल, जिससे वे declarative UI भेजते हैं और ऐप्स उसे अपने native components से render करते हैं
OpenUI (Thesys)★ 16.1kमॉडल से बनी UI को स्ट्रीम करने के लिए एक खुला स्टैंडर्ड और React रनटाइम
assistant-ui★ 13.5kChatGPT जैसा UX, composable React primitives के रूप में