
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
json-to-reactflow
Advanced tools
json-to-reactflow
Turn structured JSON into an editable, interactive visual flow powered by React Flow. Now supports deeply nested inputs/outputs, folders, dynamic forms, and visual routing.
📦 Modular | ✨ Real-time Editing | 🧠 AI-Compatible | 🧩 Plug-and-play
npm install json-to-reactflow
import { JsonToReactFlow } from "json-to-reactflow";
import { flowJson, sidebarJson } from "./your-json-data";
function App() {
return (
<div style={{ width: "100vw", height: "100vh" }}>
<JsonToReactFlow flowJson={flowJson} sidebarJson={sidebarJson} />
</div>
);
}
JsonToReactFlow Props| Prop | Type | Required | Description |
|---|---|---|---|
flowJson | FlowJson | ✅ | JSON describing canvas, nodes, edges, and background |
sidebarJson | SideBarJsonType | ❌ | Optional. Sidebar with folders, templates, and previews. |
export interface FlowJson {
export?: boolean;
control?: boolean;
minimap?: boolean;
background?: {
color?: string;
bgcolor?: string;
variant?: "dots" | "lines" | "cross";
size?: number;
};
nodes: Node[]; // visit https://reactflow.dev/api-reference/types/node for more info
edges: Edge[]; // visit https://reactflow.dev/api-reference/types/edge for more info
}
SideBarJsonTypetype SideBarJsonType = {
folders: Folder[];
};
type Folder = {
folderName: string;
icon: string;
item: Item[];
};
type Item = {
label: string;
icon: string;
data: NodeData;
};
NodeData Interfacetype NodeData = {
name?: string;
display_name?: string;
display_icon?: string;
description?: string;
inputs?: InputField[];
outputs?: Output[];
[key: string]: any;
};
type InputField = {
name: string;
label?: string;
placeholder?: string;
type: "text" | "dropdown" | "checkbox" | "switch";
options?: string[];
defaultValue?: any;
handlePresent?: boolean;
value: string | boolean;
required?: boolean;
};
type OutputField = {
name: string;
type: string;
description?: string;
};
For a more extensive example JSON, please visit FlowJson.ts on GitHub.
export const sidebarJson: TestJsonType = {
folders: [
{
folderName: "Inputs",
icon: "input",
item: [
{
label: "Text Input",
icon: "text",
data: {
name: "TextInputNode",
display_name: "Text Input",
description: "A simple text input node.",
inputs: [
{
name: "textInput",
label: "Enter text",
type: "text",
placeholder: "Type something...",
required: true,
handlePresent: true,
value: "",
},
],
outputs: [
{
name: "textOutput",
type: "text",
description: "User-entered text",
},
],
},
},
],
},
],
};
export const flowJson: FlowJson = {
export: true,
control: true,
minimap: true,
background: {
color: "#000000",
bgcolor: "#ffffff",
variant: "cross",
size: 1,
},
nodes: [
{
id: "node_1",
type: "custom",
position: { x: 100, y: 150 },
data: {
name: "OpenAIChatNode",
display_name: "OpenAI Chat",
description: "Send prompt to OpenAI and get results",
inputs: [
{
name: "prompt",
label: "Enter Prompt",
type: "text",
placeholder: "Enter your prompt...",
required: true,
handlePresent: true,
value: "",
},
{
name: "system_message",
type: "text",
label: "System Message",
placeholder: "Type something...",
required: true,
handlePresent: true,
value: "",
},
{
name: "model",
type: "dropdown",
label: "Enter OpenAI model",
options: ["gpt-3.5-turbo", "gpt-4"],
placeholder: "Select model",
required: true,
handlePresent: false,
value: "",
},
{
name: "key",
type: "text",
label: "OpenAI API Key",
placeholder: "",
required: true,
handlePresent: true,
value: "",
},
],
outputs: [
{
name: "Response Text",
type: "text",
description: "The raw response from the model",
},
{
name: "Full JSON Response",
type: "data",
description: "The complete JSON response object",
},
],
},
},
// Other nodes (node_2)...
],
edges: [
{
id: "e1",
source: "node_2",
target: "node_1",
targetHandle: "input-prompt",
animated: true,
label: "Prompt input",
},
],
};
inputs and outputsHere is the updated License section with the full MIT license text you provided:
MIT License
Copyright (c) 2024 json-to-reactflow
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
FAQs
Library to convert any json into a customisable diagram using react-flow
The npm package json-to-reactflow receives a total of 1 weekly downloads. As such, json-to-reactflow popularity was classified as not popular.
We found that json-to-reactflow demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.