react-three-fiber
vercel-labs/json-render
Render interactive 3D scenes from JSON specs using React Three Fiber and Three.js
What is react-three-fiber?
@json-render/react-three-fiber is a React Three Fiber renderer for json-render that lets you build 3D scenes declaratively from JSON specifications. Use it when you need to render 3D meshes, lights, models, and environments without writing imperative Three.js code, or when integrating 3D content into json-render catalogs.
- Render 19 built-in 3D components (primitives, lights, cameras, controls, models, environments)
- Define 3D scenes as JSON specs with a flat element structure
- Load GLTF/GLB models and HDRI environment maps
- Apply materials with metalness, roughness, emissive properties, and transparency
- Support shadows, fog, grids, and 3D text rendering
- Compose scenes with Groups and OrbitControls for interactive navigation
How to install react-three-fiber
npx skills add https://github.com/vercel-labs/json-render --skill react-three-fiber- @react-three/fiber >= 8.0.0
- @react-three/drei >= 9.0.0
- three >= 0.160.0
- react ^19.0.0
- zod ^4.0.0
How to use react-three-fiber
- 1.Import component definitions from @json-render/react-three-fiber/catalog (Box, Sphere, Lights, etc.)
- 2.Define a catalog using defineCatalog with your selected 3D component definitions
- 3.Create a registry using defineRegistry with matching component implementations
- 4.Write your 3D scene as a JSON spec with a root element and nested children
- 5.Render using ThreeCanvas (convenience wrapper) or Canvas + ThreeRenderer (manual setup)
- 6.Customize camera, shadows, and canvas styling via props or Canvas configuration
Use cases
- Build interactive product visualizers from JSON scene definitions
- Create data visualization dashboards with 3D charts and models
- Render architectural or design previews from structured scene specs
- Integrate 3D content into json-render catalogs alongside other component types
- Generate dynamic 3D environments with lighting and materials from configuration
- Full-stack developers building 3D web experiences with React
- Teams using json-render for declarative UI and wanting 3D support
- Developers familiar with Three.js looking for a JSON-driven approach
- Product teams needing configurable 3D visualizations without custom code
react-three-fiber FAQ
@json-render/react-three-fiber/catalog exports schemas only (safe for server, no R3F dependency). @json-render/react-three-fiber exports implementations (ThreeRenderer, ThreeCanvas, threeComponents) for client-side rendering.
Yes, use the Model component with a url prop to load GLTF/GLB files. You can also use Environment for HDRI maps.
Include OrbitControls in your scene spec with props like enableDamping, enableZoom, and autoRotate to enable camera controls.
Yes, you can define custom components using the shared schemas (vector3Schema, materialSchema, transformProps, shadowProps) and add them to your catalog and registry.
No, the entire scene is defined in JSON. You only write TypeScript/React for catalog and registry setup; all 3D content is declarative.
Full instructions (SKILL.md)
Source of truth, from vercel-labs/json-render.
name: react-three-fiber description: 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.
@json-render/react-three-fiber
React Three Fiber renderer for json-render. 19 built-in 3D components.
Two Entry Points
| 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 |
Usage Pattern
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,
},
});
Rendering
ThreeCanvas (convenience wrapper)
<ThreeCanvas
spec={spec}
registry={registry}
shadows
camera={{ position: [5, 5, 5], fov: 50 }}
style={{ width: "100%", height: "100vh" }}
/>
Manual Canvas setup
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>
Available Components (19)
Primitives (7)
Box-- width, height, depth, materialSphere-- radius, widthSegments, heightSegments, materialCylinder-- radiusTop, radiusBottom, height, materialCone-- radius, height, materialTorus-- radius, tube, materialPlane-- width, height, materialCapsule-- radius, length, material
All primitives share: position, rotation, scale, castShadow, receiveShadow, material.
Lights (4)
AmbientLight-- color, intensityDirectionalLight-- position, color, intensity, castShadowPointLight-- position, color, intensity, distance, decaySpotLight-- position, color, intensity, angle, penumbra
Other (8)
Group-- 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)
Shared Schemas
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",
};
Material Schema
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
});
Spec Format
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": []
}
}
}
Dependencies
Peer dependencies required:
@react-three/fiber>= 8.0.0@react-three/drei>= 9.0.0three>= 0.160.0react^19.0.0zod^4.0.0
Related skills
More from vercel-labs/json-render and the wider catalog.

redux
Redux adapter for json-render's StateStore interface. Use when integrating json-render with Redux or Redux Toolkit for state management via @json-render/redux.

remotion
Remotion renderer for json-render that turns JSON timeline specs into videos. Use when working with @json-render/remotion, building video compositions from JSON, creating video catalogs, or rendering AI-generated video timelines.

remotion-best-practices
Best practices for Remotion - Video creation in React

shadcn
36 pre-built shadcn/ui components for json-render with Radix UI + Tailwind CSS.

shadcn-svelte
Pre-built shadcn-svelte components for json-render Svelte apps. Use when working with @json-render/shadcn-svelte, adding standard UI components to a Svelte catalog, or building Svelte web UIs with shadcn-svelte + Tailwind CSS components.

skill-creator
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.