Workflow Canvas
Interactive canvas for building visual AI workflow diagrams. Features drag-and-drop nodes, automatic edge routing, zoom/pan controls, mini-map, and undo/redo. Perfect for creating complex automation workflows.
Note: This component is currently under development. Some features may not work as expected. We're actively working on improvements and will update the documentation once stable.
Preview
Installation
Usage
Examples
Simple Workflow
Read-only Mode
Without Minimap/Controls
With Custom Event Handlers
Props
| Name | Type | Default | Description |
|---|---|---|---|
initialNodes | Node[] | [] | |
initialEdges | Edge[] | [] | |
nodeTypes | Record<string, React.ComponentType<any>> | — | |
onNodesChange | OnNodesChange | — | Callback when nodes are added, removed, or modified |
onEdgesChange | OnEdgesChange | — | Callback when edges are added, removed, or modified |
onConnect | OnConnect | — | Callback when two nodes are connected |
readOnly | boolean | false | |
showMiniMap | boolean | true | |
showControls | boolean | true | Display zoom/pan controls |
showBackground | boolean | true | |
backgroundVariant | 'dots' | 'lines' | 'cross' | 'dots' | |
isRTL | boolean | false | |
className | string | — | Additional CSS classes |
fitViewOptions | FitViewOptions | { padding: 0.2 } | |
defaultEdgeOptions | DefaultEdgeOptions | { animated: false, type: 'smoothstep' } |
Accessibility
Keyboard Navigation
- Arrow Keys: Pan the canvas when a node is not selected
- + / -: Zoom in/out
- Delete: Delete selected nodes or edges
- Ctrl/Cmd + A: Select all nodes
Mouse Interactions
- Click and drag nodes to move them
- Click handles to create connections
- Scroll to zoom in/out
- Click and drag canvas to pan
Screen Reader
The canvas provides semantic structure for nodes and connections. Each node is focusable and announces its type and label to screen readers.
RTL Support
The workflow canvas automatically adjusts for RTL layouts. Node connections flow from right to left, and handle positions are mirrored appropriately.
Left-to-Right (LTR)
Right-to-Left (RTL)
Related Components
Base node component for workflows
Container component used in nodes
Status and label indicators