From vercel-labs-json-render-1
Converts JSON specs into full Next.js applications with routes, layouts, SSR, and metadata. Use for AI-generated or declarative multi-page apps.
How this skill is triggered — by the user, by Claude, or both
Slash command
/vercel-labs-json-render-1:nextThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Next.js renderer that converts JSON specs into full Next.js applications with routes, pages, layouts, metadata, and SSR support.
Next.js renderer that converts JSON specs into full Next.js applications with routes, pages, layouts, metadata, and SSR support.
npm install @json-render/core @json-render/react @json-render/next
// lib/spec.ts
import type { NextAppSpec } from "@json-render/next";
export const spec: NextAppSpec = {
metadata: {
title: { default: "My App", template: "%s | My App" },
description: "A json-render Next.js application",
},
layouts: {
main: {
root: "shell",
elements: {
shell: { type: "Container", props: {}, children: ["nav", "slot"] },
nav: { type: "NavBar", props: { links: [
{ href: "/", label: "Home" },
{ href: "/about", label: "About" },
]}, children: [] },
slot: { type: "Slot", props: {}, children: [] },
},
},
},
routes: {
"/": {
layout: "main",
metadata: { title: "Home" },
page: {
root: "hero",
elements: {
hero: { type: "Card", props: { title: "Welcome" }, children: [] },
},
},
},
"/about": {
layout: "main",
metadata: { title: "About" },
page: {
root: "content",
elements: {
content: { type: "Card", props: { title: "About Us" }, children: [] },
},
},
},
},
};
// lib/app.ts
import { createNextApp } from "@json-render/next/server";
import { spec } from "./spec";
export const { Page, generateMetadata, generateStaticParams } = createNextApp({
spec,
loaders: {
// Server-side data loaders (optional)
loadPost: async ({ slug }) => {
const post = await getPost(slug as string);
return { post };
},
},
});
// app/[[...slug]]/page.tsx
export { Page as default, generateMetadata, generateStaticParams } from "@/lib/app";
// app/[[...slug]]/layout.tsx
import { NextAppProvider } from "@json-render/next";
import { registry, handlers } from "@/lib/registry";
export default function Layout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>
<NextAppProvider registry={registry} handlers={handlers}>
{children}
</NextAppProvider>
</body>
</html>
);
}
The top-level spec defines an entire Next.js application:
Slot component)Routes use Next.js URL conventions:
"/" -- home page"/about" -- static route"/blog/[slug]" -- dynamic segment"/docs/[...path]" -- catch-all segment"/settings/[[...path]]" -- optional catch-all segmentLayouts wrap page content. Every layout MUST include a Slot component where page content will be rendered. Layouts are defined once in spec.layouts and referenced by routes via the layout field.
next/link){ statePath, value }{ statePath, value, clearStatePath? }{ statePath, index }{ href }Server-side async functions that run in the Server Component before rendering. Results are merged into the page's initial state.
createNextApp({
spec,
loaders: {
loadPost: async ({ slug }) => {
const post = await db.post.findUnique({ where: { slug } });
return { post };
},
},
});
Pages are server-rendered automatically. The createNextApp Page component is an async Server Component that:
@json-render/next -- Client components (NextAppProvider, PageRenderer, Link)@json-render/next/server -- Server utilities (createNextApp, matchRoute, schema)@json-render/next/server)createNextApp(options) -- Create Page, generateMetadata, generateStaticParamsschema -- Custom schema for Next.js apps (for AI catalog generation)matchRoute(spec, pathname) -- Match a URL to a route specresolveMetadata(spec, route) -- Resolve metadata for a routeslugToPath(slug) -- Convert catch-all slug array to pathnamecollectStaticParams(spec) -- Collect static params for all routes@json-render/next)NextAppProvider -- Context provider for registry and handlersPageRenderer -- Renders a page spec with optional layoutNextErrorBoundary -- Error boundary componentNextLoading -- Loading state componentNextNotFound -- Not-found componentLink -- Built-in navigation component (wraps next/link)npx claudepluginhub vercel-labs/json-renderImplements Next.js App Router with file-system routing, root/nested layouts, templates, loading/error/not-found states, dynamic routes, and generateStaticParams for modern Next.js 13+ apps.
Guides building Next.js 14+ apps with App Router, Server Components, Server Actions, and metadata for SEO. Covers route handlers, middleware, API routes, streaming SSR, and deployment to Vercel.
Senior Next.js 14+ specialist for App Router, server components, server actions, data fetching, SEO with generateMetadata, streaming SSR, loading/error boundaries, and Vercel deployment.