codegen
無料Code generation utilities for json-render. Use when generating code from UI specs, building custom code exporters, traversing specs, or serializing props for @json-render/codegen.
日本語の概要は準備中です。原文の説明を表示しています。
React Three Fiber 3D renderer for json-render. Use when working with @json-render/react-three-fiber, building 3D scenes from JSON specs, rendering meshes/lights/models/environments, or integrating Three.js with json-render catalogs.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
React Three Fiber renderer for json-render. 19 built-in 3D components.
| Entry Point | Exports | Use For |
|---|---|---|
@json-render/react-three-fiber/catalog | threeComponentDefinitions | Catalog schemas (no R3F dependency, safe for server) |
@json-render/react-three-fiber | threeComponents, ThreeRenderer, ThreeCanvas, schemas | R3F implementations and renderer |
Pick the 3D components you need from the standard definitions:
import { defineCatalog } from "@json-render/core";
import { schema } from "@json-render/react/schema";
import { threeComponentDefinitions } from "@json-render/react-three-fiber/catalog";
import { defineRegistry } from "@json-render/react";
import { threeComponents, ThreeCanvas } from "@json-render/react-three-fiber";
// Catalog: pick definitions
const catalog = defineCatalog(schema, {
components: {
Box: threeComponentDefinitions.Box,
Sphere: threeComponentDefinitions.Sphere,
AmbientLight: threeComponentDefinitions.AmbientLight,
DirectionalLight: threeComponentDefinitions.DirectionalLight,
OrbitControls: threeComponentDefinitions.OrbitControls,
},
actions: {},
});
// Registry: pick matching implementations
const { registry } = defineRegistry(catalog, {
components: {
Box: threeComponents.Box,
Sphere: threeComponents.Sphere,
AmbientLight: threeComponents.AmbientLight,
DirectionalLight: threeComponents.DirectionalLight,
OrbitControls: threeComponents.OrbitControls,
},
});
<ThreeCanvas
spec={spec}
registry={registry}
shadows
camera={{ position: [5, 5, 5], fov: 50 }}
style={{ width: "100%", height: "100vh" }}
/>
import { Canvas } from "@react-three/fiber";
import { ThreeRenderer } from "@json-render/react-three-fiber";
<Canvas shadows>
<ThreeRenderer spec={spec} registry={registry}>
{/* Additional R3F elements */}
</ThreeRenderer>
</Canvas>
Box -- width, height, depth, materialSphere -- radius, widthSegments, heightSegments, materialCylinder -- radiusTop, radiusBottom, height, materialCone -- radius, height, materialTorus -- radius, tube, materialPlane -- width, height, materialCapsule -- radius, length, materialAll primitives share: position, rotation, scale, castShadow, receiveShadow, material.
AmbientLight -- color, intensityDirectionalLight -- position, color, intensity, castShadowPointLight -- position, color, intensity, distance, decaySpotLight -- position, color, intensity, angle, penumbraGroup -- container with position/rotation/scale, supports childrenModel -- GLTF/GLB loader via url propEnvironment -- HDRI environment map (preset, background, blur, intensity)Fog -- linear fog (color, near, far)GridHelper -- reference grid (size, divisions, color)Text3D -- SDF text (text, fontSize, color, anchorX, anchorY)PerspectiveCamera -- camera (position, fov, near, far, makeDefault)OrbitControls -- orbit controls (enableDamping, enableZoom, autoRotate)Reusable Zod schemas for custom 3D catalog definitions:
import { vector3Schema, materialSchema, transformProps, shadowProps } from "@json-render/react-three-fiber";
import { z } from "zod";
// Custom 3D component
const myComponentDef = {
props: z.object({
...transformProps,
...shadowProps,
material: materialSchema.nullable(),
myCustomProp: z.string(),
}),
description: "My custom 3D component",
};
materialSchema = z.object({
color: z.string().nullable(), // default "#ffffff"
metalness: z.number().nullable(), // default 0
roughness: z.number().nullable(), // default 1
emissive: z.string().nullable(), // default "#000000"
emissiveIntensity: z.number().nullable(), // default 1
opacity: z.number().nullable(), // default 1
transparent: z.boolean().nullable(), // default false
wireframe: z.boolean().nullable(), // default false
});
3D specs use the standard json-render flat element format:
{
"root": "scene",
"elements": {
"scene": {
"type": "Group",
"props": { "position": [0, 0, 0] },
"children": ["light", "box"]
},
"light": {
"type": "AmbientLight",
"props": { "intensity": 0.5 },
"children": []
},
"box": {
"type": "Box",
"props": {
"position": [0, 0.5, 0],
"material": { "color": "#4488ff", "metalness": 0.3, "roughness": 0.7 }
},
"children": []
}
}
}
Peer dependencies required:
@react-three/fiber >= 8.0.0@react-three/drei >= 9.0.0three >= 0.160.0react ^19.0.0zod ^4.0.0まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Code generation utilities for json-render. Use when generating code from UI specs, building custom code exporters, traversing specs, or serializing props for @json-render/codegen.
日本語の概要は準備中です。原文の説明を表示しています。
Core package for defining schemas, catalogs, and AI prompt generation for json-render. Use when working with @json-render/core, defining schemas, creating catalogs, or building JSON specs for UI/video generation.
日本語の概要は準備中です。原文の説明を表示しています。
Drop-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 actions, follow stream patches live, browse a catalog, or pick DOM elements to find their spec keys. Triggers include "add devtools", "debug json-render", "inspect the spec", "why is this element not rendering", "see the state at runtime", or requests to tap streams / capture action logs for `@json-render/devtools`.
日本語の概要は準備中です。原文の説明を表示しています。
React adapter for the json-render devtools inspector. Use whenever the user wants to add, configure, or troubleshoot @json-render/devtools-react in a React json-render app, including spec inspection, state editing, action and stream timelines, catalog browsing, or DOM picking.
日本語の概要は準備中です。原文の説明を表示しています。
SolidJS adapter for the json-render devtools inspector. Use whenever the user wants to add, configure, or troubleshoot @json-render/devtools-solid in a SolidJS json-render app, including spec inspection, state editing, action and stream timelines, catalog browsing, or DOM picking.
日本語の概要は準備中です。原文の説明を表示しています。
Svelte 5 adapter for the json-render devtools inspector. Use whenever the user wants to add, configure, or troubleshoot @json-render/devtools-svelte in a Svelte json-render app, including spec inspection, state editing, action and stream timelines, catalog browsing, or DOM picking.
日本語の概要は準備中です。原文の説明を表示しています。