Soenneker.Blazor.Drawflow
4.0.559
Prefix Reserved
dotnet add package Soenneker.Blazor.Drawflow --version 4.0.559
NuGet\Install-Package Soenneker.Blazor.Drawflow -Version 4.0.559
<PackageReference Include="Soenneker.Blazor.Drawflow" Version="4.0.559" />
<PackageVersion Include="Soenneker.Blazor.Drawflow" Version="4.0.559" />
<PackageReference Include="Soenneker.Blazor.Drawflow" />
paket add Soenneker.Blazor.Drawflow --version 4.0.559
#r "nuget: Soenneker.Blazor.Drawflow, 4.0.559"
#:package Soenneker.Blazor.Drawflow@4.0.559
#addin nuget:?package=Soenneker.Blazor.Drawflow&version=4.0.559
#tool nuget:?package=Soenneker.Blazor.Drawflow&version=4.0.559
Soenneker.Blazor.Drawflow
A Blazor component and interop API for building editable, node-based diagrams with Drawflow.
Installation
dotnet add package Soenneker.Blazor.Drawflow
Setup
Register the interop service in Program.cs:
using Soenneker.Blazor.Drawflow.Registrars;
builder.Services.AddDrawflowInteropAsScoped();
Add the component namespace to _Imports.razor:
@using Soenneker.Blazor.Drawflow
@using Soenneker.Blazor.Drawflow.Options
Create an editor
Give the component an explicit height; Drawflow needs a sized container to render a usable canvas.
<Drawflow @ref="_flow"
Options="_options"
OnNodeSelected="HandleSelection"
style="height: 32rem; width: 100%;" />
@code {
private Drawflow? _flow;
private readonly DrawflowOptions _options = new()
{
Reroute = true,
ZoomMin = 0.4,
ZoomMax = 1.8,
UseUuid = true
};
private Task HandleSelection(List<string> nodeIds)
{
// nodeIds contains the current selection reported by Drawflow.
return Task.CompletedTask;
}
}
The editor is created after its first render. Call methods through the component reference from a user action or after the parent component has rendered—not during OnInitialized{Async}.
Add nodes and connections
await _flow!.AddNode(
name: "source",
inputs: 0,
outputs: 1,
posX: 80,
posY: 120,
className: "source-node",
data: new { endpoint = "/orders" },
html: "<strong>Orders</strong>");
await _flow.AddNode(
name: "processor",
inputs: 1,
outputs: 0,
posX: 360,
posY: 120,
className: "processor-node",
data: null,
html: "<strong>Process order</strong>");
string sourceId = (await _flow.GetNodesFromName("source")).Single();
string processorId = (await _flow.GetNodesFromName("processor")).Single();
await _flow.AddConnection(sourceId, processorId, "output_1", "input_1");
Node HTML is inserted into the page by Drawflow. Never pass unsanitized user content to AddNode, SetNodeHtml, or imported flow data.
Save and restore a flow
string json = await _flow!.ExportAsJson();
await _flow.Import(json);
Use Export() and Import(DrawflowExport) when you prefer the models from Soenneker.Blazor.Drawflow.Dtos. Treat imported JSON as untrusted input: validate its size and contents before rendering it.
Events
The component exposes callbacks for node, connection, module, selection, data, zoom, reroute, translation, import, and export events. OnNodeSelected and OnNodeUnselected provide List<string> values. The other callbacks expose Drawflow's JavaScript arguments as a JSON array in a string, so deserialize the payload according to the event you subscribe to.
Asset loading
Drawflow's pinned JavaScript and CSS are loaded from jsDelivr by default with integrity checks. Set UseCdn = false to use the copies packaged with the NuGet package. Use the same setting for every Drawflow component in a scoped session because the shared assets are initialized once.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Soenneker.Asyncs.Initializers (>= 4.0.102)
- Soenneker.Blazor.Drawflow.Dtos (>= 4.0.27)
- Soenneker.Blazor.Utils.InteropEventListener (>= 4.0.4141)
- Soenneker.Blazor.Utils.ResourceLoader (>= 4.0.1756)
- Soenneker.Extensions.List (>= 4.0.992)
- Soenneker.Lepton.Suite (>= 4.0.87)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.559 | 58 | 9/17/2026 |
| 4.0.558 | 51 | 9/16/2026 |
| 4.0.557 | 46 | 9/16/2026 |
| 4.0.556 | 43 | 9/16/2026 |
| 4.0.555 | 47 | 9/16/2026 |
| 4.0.554 | 59 | 9/16/2026 |
| 4.0.553 | 67 | 9/15/2026 |
| 4.0.552 | 75 | 9/15/2026 |
| 4.0.551 | 96 | 9/14/2026 |
| 4.0.550 | 91 | 9/13/2026 |
| 4.0.549 | 84 | 9/13/2026 |
| 4.0.548 | 87 | 9/13/2026 |
| 4.0.547 | 89 | 9/13/2026 |
| 4.0.546 | 89 | 9/13/2026 |
| 4.0.545 | 92 | 9/13/2026 |
| 4.0.542 | 86 | 9/12/2026 |
| 4.0.541 | 95 | 9/12/2026 |
| 4.0.540 | 84 | 9/12/2026 |
| 4.0.538 | 87 | 9/10/2026 |
| 4.0.537 | 91 | 9/10/2026 |
Updated Multiple NuGet packages