If you're building code generators on top of json-render UI specs, this gives you the traversal and serialization primitives you need. You get utilities to walk spec trees depth-first, collect all referenced components and state paths, and serialize props into JSX-compatible strings with proper escaping. The serialization handles the annoying bits like knowing when to wrap values in braces versus quotes. It's framework-agnostic, so you can build exporters for Next.js, Remix, or whatever else. The API is straightforward: a handful of focused functions that do one thing each, which is exactly what you want when you're stitching together a code generator.

skills.sh installs
8.9K
GitHub stars
19.5K
last updated
Aug 21, 2026

Install

$ npx -y skills add vercel-labs/json-render --skill codegen --agent claude-code

Installs into .claude/skills of the current project.

Files

@json-render/codegen

Framework-agnostic utilities for generating code from json-render UI trees. Use these to build custom code exporters for Next.js, Remix, or other frameworks.

Installation

npm install @json-render/codegen

Tree Traversal

import {
  traverseSpec,
  collectUsedComponents,
  collectStatePaths,
  collectActions,
} from "@json-render/codegen";

// Walk the spec depth-first
traverseSpec(spec, (element, key, depth, parent) => {
  console.log(`${" ".repeat(depth * 2)}${key}: ${element.type}`);
});

// Get all component types used
const components = collectUsedComponents(spec);
// Set { "Card", "Metric", "Button" }

// Get all state paths referenced
const statePaths = collectStatePaths(spec);
// Set { "analytics/revenue", "user/name" }

// Get all action names
const actions = collectActions(spec);
// Set { "submit_form", "refresh_data" }

Serialization

import {
  serializePropValue,
  serializeProps,
  escapeString,
  type SerializeOptions,
} from "@json-render/codegen";

// Serialize a single value
serializePropValue("hello");
// { value: '"hello"', needsBraces: true }

Sponsors

Details

Repository
github.com/vercel-labs/json-render
Category
Cloud & Infrastructure
First seen
May 16, 2026

More from vercel-labs/json-render

All 31
1vercel-labs avatarnextvercel-labs/json-renderNext.js renderer for json-render that turns JSON specs into full Next.js applications with routes, layouts, SSR, and metadata. Use when working with @json-rende8.6Kskills.sh installs
2vercel-labs avatardevtoolsvercel-labs/json-renderDrop-in inspector panel for any json-render app. Use when the user wants to debug a generative UI, inspect the spec tree, edit state at runtime, see dispatched 8.4Kskills.sh installs
3vercel-labs avatardirectivesvercel-labs/json-renderPre-built custom directives for json-render — formatting, math, string manipulation, and i18n. Use when working with @json-render/directives, defining custom di8.1Kskills.sh installs
4vercel avatarevevercel/eveBuild durable backend AI agents with the eve framework. Use when creating, editing, or debugging an eve project — agent instructions, skills, tools, connections7.8Kskills.sh installs
5aws avatarconnecting-to-data-sourceaws/agent-toolkit-for-awsCreate and troubleshoot AWS Glue connections to JDBC databases (Oracle, SQL Server, PostgreSQL, MySQL, RDS), Redshift, Snowflake, and BigQuery. Gathers connecti7.2Kskills.sh installs
6aws avatarcreating-secrets-using-best-practicesaws/agent-toolkit-for-awsCreates and manages secrets in AWS Secrets Manager following security best practices. Always use this skill when creating secrets — it sets up dedicated KMS enc7.2Kskills.sh installs