Workflow Canvas
Work in Progress
Canvas component for building node-based workflows with drag-and-drop, pan/zoom, minimap, and controls. Perfect for automation builders.
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
Terminalbash
Usage
Reacttsx
Examples
Simple Workflow
tsx
Read-only Mode
tsx
Without Minimap/Controls
tsx
With Custom Event Handlers
Props
| Name | Type | Default | Description |
|---|---|---|---|
initialNodes | Node[] | [] | Initial nodes for the workflow |
initialEdges | Edge[] | [] | Initial edges/connections between nodes |
nodeTypes | Record<string, React.ComponentType<any>> | — | Custom node type components |
onNodesChange | OnNodesChange | — | Callback when nodes change (move, select, delete) |
onEdgesChange | OnEdgesChange | — | Callback when edges change |
onConnect | OnConnect | — | Callback when nodes are connected |
readOnly | boolean | false | Whether the canvas is read-only (no editing) |
showMiniMap | boolean | true | Show the minimap navigation |
showControls | boolean | true | Show zoom and fit view controls |
showBackground | boolean | true | Show background pattern |
backgroundVariant | 'dots' | 'lines' | 'cross' | 'dots' | Background pattern variant |
isRTL | boolean | false | Whether text direction is RTL |
className | string | — | Additional CSS classes |
fitViewOptions | FitViewOptions | { padding: 0.2 } | Options for fitting the view |
defaultEdgeOptions | DefaultEdgeOptions | { animated: false, type: 'smoothstep' } | Default options for edges |
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 Considerations
The workflow canvas automatically adjusts for RTL layouts. Node connections flow from right to left, and handle positions are mirrored appropriately.
LTR (English)
RTL (العربية)
Related Components
Workflow Node
Base node component for workflows
Card
Container component used in nodes
Badge
Status and label indicators