Search

Search the site

All components

Workflow Canvas

Headless node-based workflow canvas. The component renders the graph and emits events; your app owns modals, drawers, and inspectors via onNodeSelect, onNodeDoubleClick, renderNodePicker, and renderControls.

Default
Controlled workflow with built-in add-node controls and a right-click node picker.

Add nodes with the + control, or right-click the canvas for the node picker.

Mini Map

Sign in to view this example's source code.

Sign in
Node inspector
App-owned dialog wired via onNodeSelect and onNodeDoubleClick - canvas stays headless.

Select a node to open the inspector, or double-click to open it directly. Dialog UI lives in the app layer.

No selection
Mini Map

Sign in to view this example's source code.

Sign in

Props

NameTypeDefaultDescription
nodesWorkflowNode[]RequiredWorkflow nodes with id, type, position, and display/configuration data
edgesWorkflowEdge[]RequiredConnections between workflow nodes
editablebooleantrueEnable dragging, connecting, selection, and deletion
onNodesChange(nodes: WorkflowNode[]) => voidundefinedCalled with normalized workflow nodes after canvas changes
onEdgesChange(edges: WorkflowEdge[]) => voidundefinedCalled with normalized workflow edges after canvas changes
onConnect(connection: Connection) => voidundefinedCalled when a new edge connection is created
onNodeSelect(node: WorkflowNode | null) => voidundefinedSelection event - wire to app state; open drawers/modals in your layer, not inside the canvas
onNodeDoubleClick(node: WorkflowNode) => voidundefinedDouble-click event - convenience hook to open an inspector or dialog without embedding UI in the canvas
onAddNode(node: WorkflowNode) => voidundefinedCalled when a node is added via the canvas API
onPaneContextMenu(position, event) => voidundefinedCalled on pane right-click with flow coordinates
renderNodePicker(args) => ReactNodeundefinedRender a node picker at flow position; receives addNode and close
onNodeDrop(event, position, type) => voidundefinedOptional drag-and-drop hook for external node sources (use WORKFLOW_NODE_DRAG_TYPE)
renderControls(api: WorkflowCanvasAPI) => ReactNodeundefinedCustom controls slot with imperative canvas API
showAddNodeInControlsbooleanfalseShow add-node menu on default zoom controls
refWorkflowCanvasHandleundefinedImperative API: addNode, createNode, getNodes, fitView, zoomIn, zoomOut, screenToFlowPosition
heightstring | numberundefinedExplicit canvas height; parent should size the container when omitted
autoFitViewbooleanfalseFit viewport to nodes on mount
minimapboolean | ReactNodeundefined (built-in minimap)Built-in minimap when omitted or true; false to hide; ReactNode for a custom minimap
controlsReactNode | falseundefined (built-in zoom controls)Built-in controls when omitted; false to hide; ReactNode for custom controls
backgroundbooleantrueToggle the dot grid background