Types
BackgroundVariant
The three variants are exported as an enum for convenience. You can either import the enum and use it like BackgroundVariant.Lines or you can use the raw string value directly.
Read moreConnection
The Connection type is the basic minimal description of an Edge between two nodes. The addEdge util can be used to upgrade a Connection to an Edge.
Read moreConnectionLineComponentProps
If you want to render a custom component for connection lines, you can set the connectionLineComponent prop on the ReactFlow component. The ConnectionLineComponentProps are passed to your custom component.
Read moreConnectionLineType
If you set the connectionLineType prop on your ReactFlow component, it will dictate the style of connection line rendered when creating new edges.
Read moreCoordinateExtent
A coordinate extent represents two points in a coordinate system: one in the top left corner and one in the bottom right corner. It is used to represent the bounds of nodes in the flow or the bounds of the viewport.
Read moreDefaultEdgeOptions
Many properties on an Edge are optional. When a new edge is created, the properties that are not provided will be filled in with the default values passed to the defaultEdgeOptions prop of the ReactFlow component.
Read moreEdge
Where a Connection is the minimal description of an edge between two nodes, an Edge
is the complete description with everything React Flow needs to know in order to render it.
EdgeChange
The onEdgesChange callback takes an array of EdgeChange objects that you should use to update your flow's state. The EdgeChange type is a union of four different object types that represent that various ways an edge can change in a flow.
Read moreEdgeMarker
Edges can optionally have markers at the start and end of an edge. The EdgeMarker type is used to configure those markers! Check the docs for MarkerType for details on what types of edge marker are available.
Read moreEdgeProps
When you implement a custom edge it is wrapped in a component that enables some basic functionality. Your custom edge component receives the following props:
Read moreFitViewOptions
When calling fitView these options can be used to customize the behaviour. For example, the duration option can be used to transform the viewport smoothly over a given amount of time.
Read moreMarkerType
Edges may optionally have a marker on either end. The MarkerType type enumerates the options available to you when configuring a given marker.
Read moreMiniMapNodeProps
Node
The Node type represents everything React Flow needs to know about a given node. Many of these properties can be manipulated both by React Flow or by you, but some such as width and height should be considered read-only.
Read moreNodeChange
The onNodesChange callback takes an array of NodeChange objects that you should use to update your flow's state. The NodeChange type is a union of six different object types that represent that various ways an node can change in a flow.
Read moreNodeProps
When you implement a custom node it is wrapped in a component that enables basic functionality like selection and dragging. Your custom node receives the following props:
Read morePanOnScrollMode
This enum is used to set the different modes of panning the viewport when the user scrolls.
Read morePanelPosition
This type is mostly used to help position things on top of the flow viewport. For example both the MiniMap and Controls components take a position prop of this type.
Read morePosition
While PanelPosition can be used to place a component in the corners of a container, the Position enum is less precise and used primarily in relation to edges and handles.
Read moreProOptions
By default, we render a small attribution in the corner of your flows that links back to the project. Anyone is free to remove this attribution whether they're a Pro subscriber or not but we ask that you take a quick look at our removing attribution guide before doing so.
Read moreReactFlowInstance
The ReactFlowInstance provides a collection of methods to query and manipulate the internal state of your flow. You can get an instance by using the useReactFlow hook or attaching a listener to the onInit event.
Read moreReactFlowJsonObject
A JSON-compatible representation of your flow. You can use this to save the flow to a database for example and load it back in later.
Read moreResizeParams
The ResizeParams type is used to type the various events that are emitted by the NodeResizer component. You'll sometimes see this type extended with an additional direction field too.
Read moreViewport
Internally, React Flow maintains a coordinate system that is independent of the rest of the page. The Viewport type tells you where in that system your flow is currently being display at and how zoomed in or out it is.
Read moreNodeOrigin
The origin of a Node determines how it is placed relative to its own coordinates.
Read moreXYPosition
All positions are stored in an object with x and y coordinates.
Read more