
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.
react-flowchart-designer
Advanced tools
A lightweight component to design flowcharts. Check out the [demo](https://d5y3kk.csb.app/) for some examples.
A lightweight component to design flowcharts. Check out the demo for some examples.

Install react-flowchart-designer using npm.
npm install react-flowchart-designer
Then you can just import the component and its hook:
import { Flowchart, useFlowchart } from 'react-flowchart-designer';
and use it as below:
const { setHandles, flowchart } = useFlowchart();
<button onClick={() => { flowchart.addRectNode(50, 50, 'my node') }}>Add Node</button>
<Flowchart setHandles={setHandles} width='700px' height='400px' editable={true} />
Clicking the button creates a new node at x = 50, y = 50. Drag the orange square from one node to another to add links.
Load/save a flowchart using the data model below:
const load = () => {
let nodes = [
{ id: 1, text: 'node1', X: 50, Y: 50 },
{ id: 2, text: 'node2', X: 150, Y: 50 },
];
let links = [
{ from: 1, to: 2 },
{ from: 2, to: 2 },
];
flowchart.addNodes(nodes, links);
}
const save = () => console.log(flowchart.getData()) // { nodes: […], links: […] }
<button onClick={load}>Load</button>
<button onClick={save}>Save</button>
The following props can be defined on Flowchart:
| Prop | Type | Description | Default |
|---|---|---|---|
width * | string | Flowchart width | |
height * | string | Flowchart height | |
editable | boolean | Enable/Disable adding/removing links | false |
onReady | FlowchartHandles => any | When the flowchart is mounted |
(*) required props
You can access the handles using the Flowchart object as follows:
<button onClick={() => { flowchart!.addRhomNode(100, 100, txt) }}>Add Rhombus Node</button>
Below is a list of all handles:
| Handle | Type | Description |
|---|---|---|
addRectNode | (left: number, top: number, text: string, id?: number, color?: string) => number | Adds a rectangle node at (left, top), returns its id |
addCircleNode | (left: number, top: number, text: string, id?: number, color?: string) => number | Adds a circle node at (left, top), returns its id |
addRhomNode | (left: number, top: number, text: string, id?: number, color?: string) => number | Adds a rhombus node at (left, top), returns its id |
addNodes | (nodes: NodeData[], links?: LinkData[]) => void | Adds multiple nodes and links (see Loading a Flowchart) |
getData | () => { nodes: NodeData[], links: LinkData[] } | Gets all nodes and links (see Saving a Flowchart) |
changeLinkType | (id: number, type: string) => void | Changes the type of a link (solid/dashed) |
Below is the data model for nodes:
| Prop | Type | Description | Default |
|---|---|---|---|
id | number | Node identifier | |
X * | number | The x position of the node | |
Y * | number | The y position of the node | |
text * | string | Node text | |
color | string | Node color | white |
shape | string | Node shape can be rectangle, circle, or rhombus | rectangle |
(*) required props
Below is the data model for links:
| Prop | Type | Description | Default |
|---|---|---|---|
from * | number | The id of the origin node | |
to * | number | The id of the destination node | |
text | string | Link label | |
type | string | Link type (solid/dashed) | solid |
meta | object | Information about the shape of the link |
(*) required props
npm run ladle.flowchart.stories.tsx or your own Stories (*.stories.tsx).React Flowchart has no dependency. However the following peer dependencies must be specified by your project in order to avoid version conflicts:
react,
react-dom.
NPM will not automatically install these for you but it will show you a warning message with instructions on how to install them.
FAQs
A lightweight component to design flowcharts. Check out the [demo](https://d5y3kk.csb.app/) for some examples.
The npm package react-flowchart-designer receives a total of 0 weekly downloads. As such, react-flowchart-designer popularity was classified as not popular.
We found that react-flowchart-designer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 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.