/syncfusion-blazor:syncfusion-blazor-diagramfrom Syncfusion Blazor Components
Build and troubleshoot Syncfusion Blazor diagrams using SfDiagramComponent. Trigger for flowcharts, org charts, mind maps, BPMN, UML sequence, swimlanes, symbol palettes, nodes/connectors/ports/annotations, layouts, data binding, serialization (load/save), export/print, and collaborative editing questions. Provide Blazor + Syncfusion setup steps, configuration patterns, and sample snippets.
Ships in Syncfusion Blazor Components. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A comprehensive skill for building interactive diagrams with the Syncfusion Blazor Diagram component — flowcharts, organizational charts, mind maps, BPMN process diagrams, UML sequence diagrams, network diagrams, and more.
Use this skill when you need to:
SfDiagramComponent, nodes, connectors, or shapesAPI Verification Required: Always verify API class names, properties, and signatures by reading reference files (references/*.md) BEFORE generating code examples. Do not assume or infer class names.
⚠️ Before writing ANY code, review the Common Mistakes section directly below to avoid known invalid APIs and properties.
@using Syncfusion.Blazor.Diagram
<SfDiagramComponent Width="100%" Height="600px" Nodes="@nodes" Connectors="@connectors" />
@code {
DiagramObjectCollection<Node> nodes = new DiagramObjectCollection<Node>
{
new Node
{
ID = "node1", OffsetX = 150, OffsetY = 150,
Width = 100, Height = 50,
Style = new ShapeStyle { Fill = "#6BA5D7", StrokeColor = "white" },
Annotations = new DiagramObjectCollection<ShapeAnnotation>
{
new ShapeAnnotation { Content = "Start" }
}
}
};
DiagramObjectCollection<Connector> connectors = new DiagramObjectCollection<Connector>
{
new Connector { ID = "conn1", SourceID = "node1", TargetID = "node2" }
};
}
| Goal | Reference |
|---|---|
| First diagram setup | references/getting-started.md |
| Add/configure nodes | references/nodes.md |
| Add/configure connectors | references/connectors.md |
| Use built-in shapes | references/shapes.md |
| Add text labels | references/annotations.md |
| Define connection points | references/ports.md |
| Org charts / auto-layout | references/layout.md |
| Swimlane diagrams | references/swimlane.md |
| BPMN process diagrams | references/bpmn.md |
| Drag-and-drop palette | references/symbol-palette.md |
| Bind data to diagram | references/data-binding.md |
| Selection, drag, zoom | references/interaction.md |
| Handle diagram events | references/events.md |
| Save and load diagrams | references/serialization.md |
| Export / print | references/export-print.md |
| CSS / theme styling | references/styling.md |
| UML sequence diagrams | references/uml-sequence.md |
| Real-time collaboration | references/collaborative-editing.md |
| Context menu, tooltips, rulers, localization | references/advanced-features.md |
| Miniature overview / bird's-eye navigation | references/overview-component.md |
📄 Read: references/getting-started.md
Syncfusion.Blazor.Diagram)📄 Read: references/nodes.md
📄 Read: references/connectors.md
📄 Read: references/shapes.md
📄 Read: references/annotations.md
AnnotationConstraints flags, DragLimit (PathAnnotation)Hyperlink (Url, Content, OpenMode)📄 Read: references/ports.md
📄 Read: references/layout.md
await DoLayoutAsync() — refresh layout at runtime after adding/removing nodes📄 Read: references/swimlane.md
<SfDiagramComponent Height="600px" Swimlanes="@swimlanes" />
@code {
DiagramObjectCollection<Swimlane> swimlanes = new();
protected override void OnInitialized()
{
swimlanes.Add(new Swimlane
{
ID = "swimlane1",
OffsetX = 400, OffsetY = 300,
Width = 600, Height = 200,
Lanes = new DiagramObjectCollection<Lane>()
{
new Lane(){
Height = 100,
Header = new SwimlaneHeader(){
Width = 30,
Annotation = new ShapeAnnotation(){ Content = "Consumer" }
},
Children = new DiagramObjectCollection<Node>()
{
new Node(){Height = 50, Width = 50, LaneOffsetX = 250, LaneOffsetY = 30},
}
},
}
});
}
}
📄 Read: references/bpmn.md
// Exclusive gateway (XOR)
nodes.Add(new Node
{
ID = "gateway1", OffsetX = 300, OffsetY = 200, Width = 50, Height = 50,
Shape = new BpmnGateway
{
GatewayType = BpmnGatewayType.Exclusive
}
});
📄 Read: references/symbol-palette.md
SfSymbolPaletteComponent📄 Read: references/data-binding.md
await ReadDataAsync(query?), await InsertDataAsync(data), await UpdateDataAsync(keyField, data), await DeleteDataAsync(keyField, value)await RefreshDataSourceAsync() — reload all data and rebuild layout📄 Read: references/interaction.md
Select(collection, multipleSelection?), SelectAll(), UnSelect(obj), ClearSelection()Drag(obj, tx, ty), Rotate(obj, angle, pivot?), Scale(obj, sx, sy, pivot)Zoom(factor, focusPoint), ResetZoom(), Pan(hOffset, vOffset, focusPoint?)BringIntoView(DiagramRect) — scroll viewport to show a regionBringIntoCenter(DiagramRect) — scroll viewport to center a regionFitToPage(FitOptions?) — fit content to viewport (sync; FitMode.Width/Height/Both, DiagramRegion.Content/PageSettings)Nudge(Direction, int?) — move selected elements by pixels; default 1px; Direction.Top/Bottom/Left/RightBringToFront(), BringForward(), SendBackward(), SendToBack() — must Select() firstCopy(), Cut(), Paste(collection?), Delete(collection?)Group(), Ungroup(), AddChildAsync(group, child), RemoveChild(group, child)StartTextEdit(obj, annotationId?)CommandManager (custom/override shortcuts via child component)CommandManager uses KeyboardCommand + KeyGesture (DiagramKeys + ModifierKeys) + CommandKeyArgsSetAlign, SetDistribute, SetSameSize — all sync)Undo(), Redo() (sync); StartGroupAction() / EndGroupAction() for batched undo stepsAddHistoryEntry(entry), ClearHistory()GetObject(id), GetPageBounds(x?, y?), Clear() (removes all elements)BeginUpdate() + await EndUpdateAsync() — group multiple changes into one render passawait AddDiagramElementsAsync(DiagramObjectCollection<NodeBase>)📄 Read: references/events.md
📄 Read: references/serialization.md
📄 Read: references/export-print.md
📄 Read: references/styling.md
CssClass property)📄 Read: references/uml-sequence.md
await UpdateFromModelAsync() — refresh diagram after programmatic model changes📄 Read: references/uml-class-diagram.md
UmlSectionHeaderSettings), and row-level TextStyleAdd, RemoveAt, Remove)CollectionChanging / CollectionChanged events; inline text editing (F2, StartTextEdit)📄 Read: references/collaborative-editing.md
GetDiagramUpdates(HistoryChangedEventArgs) + await SetDiagramUpdatesAsync(updates) — efficient change propagation📄 Read: references/overview-component.md
SfDiagramOverviewComponent as a miniature thumbnail panelSourceID / IDWidth and HeightDiagramOverviewConstraints@using Syncfusion.Blazor.Diagram.Overview namespace.@using Syncfusion.Blazor.Diagram
@using Syncfusion.Blazor.Diagram.Overview
@using System.Collections.ObjectModel
<SfDiagramComponent ID="element"
Width="100%"
Height="500px">
</SfDiagramComponent>
<!-- Overview panel linked to the diagram above -->
<SfDiagramOverviewComponent Height="150px" SourceID="element" />
📄 Read: references/advanced-features.md
await ShowTooltipAsync(obj) / await HideTooltipAsync(obj) — requires OpensOn = "Custom"⚠️
AllowEditingdoes NOT exist onShapeAnnotationorPathAnnotation.
Inline editing is on by default — no property is needed to enable it.
To disable editing, setConstraints = AnnotationConstraints.ReadOnly:// ❌ Wrong — CS0117: AllowEditing does not exist new ShapeAnnotation { Content = "Label", AllowEditing = false } // ✅ Correct — use AnnotationConstraints.ReadOnly to disable editing new ShapeAnnotation { Content = "Label", Constraints = AnnotationConstraints.ReadOnly }
⚠️ Always use
EndUpdateAsync()(async) —EndUpdate()(sync, non-async) does NOT exist and will cause a compile error.
UseBeginUpdate()/EndUpdateAsync()when changing multiple properties at once —awaitis required:// ❌ Wrong — EndUpdate() does not exist diagram.BeginUpdate(); // ... changes ... diagram.EndUpdate(); // ✅ Correct — EndUpdateAsync is async diagram.BeginUpdate(); // ... changes ... await diagram.EndUpdateAsync();
⚠️
ClickEventArgsname collision: If your page also uses@using Syncfusion.Blazor.Navigations(or Buttons),
ClickEventArgsbecomes ambiguous. Always qualify it:// ✅ Use the fully qualified type in the handler signature private void OnClick(Syncfusion.Blazor.Diagram.ClickEventArgs args) { }
⚠️
args.Countis NOT anintfield — it is a method that returns anint.
Do NOT compare it directly with==inline without storing the result first:// ❌ Wrong — CS0019: Operator '==' cannot be applied to operands of type 'method group' and 'int' if (args.Count == 2) // ✅ Correct — store result then compare int clickCount = args.Count; if (clickCount == 2) { /* double-click */ }
⚠️
SizeChangedEventArgs.Elementis typed asDiagramSelectionSettings, notNode.
Pattern-matchingargs.Element is Node nalways fails withCS8121.
Cast toDiagramSelectionSettingsand read.Nodes[0]to get the resized node:// ❌ Wrong — CS8121: DiagramSelectionSettings cannot match Node if (args.Element is Node n) { } // ✅ Correct — Element is DiagramSelectionSettings if (args.Element is DiagramSelectionSettings sel && sel.Nodes.Count > 0) { var node = sel.Nodes[0]; double w = args.NewValue.Width; double h = args.NewValue.Height; }
⚠️
args.NewValue.Widthandargs.NewValue.Heightare plaindouble, notdouble?.
Using??on them causesCS0019. Assign them directly:// ❌ Wrong — CS0019 double w = args.NewValue.Width ?? 0; // ✅ Correct double w = args.NewValue.Width;
⚠️
SelectionChangedEventArgsname collision: If your page also uses@using Syncfusion.Blazor.Buttons
(or other Syncfusion packages),SelectionChangedEventArgsbecomes ambiguous. Always qualify it:// ✅ Fully qualified private void OnSelectionChanged(Syncfusion.Blazor.Diagram.SelectionChangedEventArgs args) { }
⚠️
args.NewValueis aDiagramSelectionSettingsobject — NOT aNode, NOT a collection:
- Pattern-matching
args.NewValue is Nodealways fails withCS8121- Iterating
args.NewValueas a collection fails — it is a single settings object- The only correct approach is to read
_diagram.SelectionSettings.Nodes/.Connectors:// ❌ Wrong — CS8121: DiagramSelectionSettings cannot match Node if (args.NewValue is Node n) { } // ❌ Wrong — DiagramSelectionSettings is not IEnumerable foreach (var item in args.NewValue) { } // ✅ Correct — use SelectionSettings on the diagram reference foreach (var node in _diagram.SelectionSettings.Nodes) Console.WriteLine(node.ID); foreach (var conn in _diagram.SelectionSettings.Connectors) Console.WriteLine(conn.ID);
⚠️
TextChangedEventArgsdoes NOT exist — using it causesCS0246.
The correct event args type isTextChangeEventArgs(nod):// ❌ Wrong — CS0246: TextChangedEventArgs not found private void OnTextChanged(TextChangedEventArgs args) { } // ✅ Correct private void OnTextChanged(TextChangeEventArgs args) { }
⚠️
DragStartEventArgsis ambiguous whenSyncfusion.Blazor.Popups(or other packages that exposeDragStartEventArgs) is also referenced.
Always qualify it asSyncfusion.Blazor.Diagram.DragStartEventArgs:// ❌ Wrong — CS0104: ambiguous reference between Diagram and Popups private void OnDragStart(DragStartEventArgs args) { } // ✅ Correct — fully qualified private void OnDragStart(Syncfusion.Blazor.Diagram.DragStartEventArgs args) { }
⚠️
DragEnterEventArgsdoes NOT exist inSyncfusion.Blazor.Diagram.
There is noDragEnterevent onSfDiagramComponentthat receives aDragEnterEventArgs.
The available drag events onSfDiagramComponentare:DragStart,Dragging,DragLeave,DragDrop— all for SymbolPalette drag-and-drop only.
For tracking when a node is being moved (internal drag), usePositionChanged:// ❌ Wrong — DragEnterEventArgs does not exist private void OnDragEnter(DragEnterEventArgs args) { } // ❌ Wrong — OnPositionChange does not exist on SfDiagramComponent <SfDiagramComponent OnPositionChange="OnPositionChange" /> // ✅ Correct — use PositionChanged <SfDiagramComponent PositionChanged="OnPositionChanged" /> private void OnPositionChanged(PositionChangedEventArgs args) { if (args.Element is Node n) Console.WriteLine($"Node {n.ID} moved to ({n.OffsetX}, {n.OffsetY})"); }
⚠️
SnapObjectDistancedoes NOT exist onSnapSettings— using it causesInvalidOperationException: does not have a property matching the name 'SnapObjectDistance'.
The correct property name isSnapDistance:@* ❌ Wrong — SnapObjectDistance does not exist *@ <SnapSettings SnapObjectDistance="5" /> @* ✅ Correct *@ <SnapSettings Constraints="SnapConstraints.SnapToObject" SnapDistance="5" />
⚠️
CssClassdoes NOT exist onSfDiagramComponent— using it causes
InvalidOperationException: Object of type 'SfDiagramComponent' does not have a property matching the name 'CssClass'.
Wrap the component in a<div>with a scoping class instead:@* ❌ Wrong — CssClass does not exist on SfDiagramComponent *@ <SfDiagramComponent CssClass="my-diagram" /> @* ✅ Correct — use a wrapper div *@ <div class="my-diagram"> <SfDiagramComponent ... /> </div>
⚠️
Phase.Offsetdoes NOT exist — using it causes a compile error.
UsePhase.Widthto set the size of a phase in a swimlane:// ❌ Wrong — Offset does not exist on Phase new Phase { ID = "ph1", Offset = 220 } // ✅ Correct — use Width new Phase { ID = "ph1", Width = 220 }
⚠️
Lane.Constraintsdoes NOT exist andLaneConstraintsenum does NOT exist.
Individual lanes cannot have constraints set via aConstraintsproperty.
To restrict swimlane-level interactions, useSwimlaneConstraintson theSwimlaneobject itself:// ❌ Wrong — Lane.Constraints and LaneConstraints do not exist lane.Constraints = LaneConstraints.Default & ~LaneConstraints.ResizeEntries; // ✅ Correct — set constraints on the Swimlane object swimlane.Constraints = SwimlaneConstraints.Default & ~SwimlaneConstraints.Interaction;
⚠️
FitMode.Pagedoes NOT exist — using it causesCS0117.
The correct values forFitModeareFitMode.WidthandFitMode.Height:// ❌ Wrong — FitMode.Page does not exist new FitOptions { Mode = FitMode.Page } // ✅ Correct — use FitMode.Width or FitMode.Height new FitOptions { Mode = FitMode.Width, Region = DiagramRegion.Content }
⚠️
SfDiagramComponent.LoadDiagram()does NOT exist — using it causes a compile error.
Use the async versionLoadDiagramAsync()instead:// ❌ Wrong — LoadDiagram() does not exist diagram.LoadDiagram(savedJson); // ✅ Correct — use LoadDiagramAsync await diagram.LoadDiagramAsync(savedJson);
⚠️
SfDiagramComponent.FitToPageAsync()does NOT exist — using it causes a compile error.
Use the non-async overloadFitToPage()instead:// ❌ Wrong — FitToPageAsync does not exist await diagram.FitToPageAsync(new FitOptions { Mode = FitMode.Width }); // ✅ Correct — use FitToPage (synchronous) diagram.FitToPage(new FitOptions { Mode = FitMode.Width, Region = DiagramRegion.Content });
⚠️
BasicShapesdoes NOT exist — useNodeBasicShapesinstead:// ❌ Wrong new BasicShape { Shape = BasicShapes.Rectangle } // ✅ Correct new BasicShape { Shape = NodeBasicShapes.Rectangle }
⚠️
DiagramThicknessdoes NOT have a 4-argument constructor — using it causesCS1729: does not contain a constructor that takes 4 arguments.
Use the object initializer syntax with named properties instead:// ❌ Wrong — CS1729: no 4-argument constructor new DiagramThickness(20, 50, 20, 20) // ✅ Correct — use object initializer with named properties new DiagramThickness { Left = 20, Top = 50, Right = 20, Bottom = 20 } // ✅ Correct — set only the sides you need new DiagramThickness { Top = 50 }
⚠️
PathAnnotation.DragLimittype isDiagramThickness— NOTMargin.
Usingnew Margin { ... }causes a type mismatch compile error (CS0029).
Always usenew DiagramThickness { ... }forDragLimit:// ❌ Wrong — CS0029: Margin cannot be assigned to DiagramThickness new PathAnnotation { Constraints = AnnotationConstraints.Interaction, DragLimit = new Margin { Left = 40, Right = 40, Top = 20, Bottom = 20 } } // ✅ Correct — DiagramThickness with object initializer new PathAnnotation { Constraints = AnnotationConstraints.Interaction, DragLimit = new DiagramThickness { Left = 40, Right = 40, Top = 20, Bottom = 20 } }
⚠️
CanAutoScrolldoes NOT exist onScrollSettings— using it causesInvalidOperationException: does not have a property matching the name 'CanAutoScroll'.
The correct property name isEnableAutoScroll:@* ❌ Wrong — CanAutoScroll does not exist *@ <ScrollSettings CanAutoScroll="true" /> @* ✅ Correct *@ <ScrollSettings EnableAutoScroll="true" />
⚠️
ZoomAsync(),UndoAsync(), andRedoAsync()do NOT exist — using them causes a compile error.
Use the non-async overloadsZoom(),Undo(), andRedo()instead:// ❌ Wrong — ZoomAsync, UndoAsync, RedoAsync do not exist await _diagram.ZoomAsync(1.2, new DiagramPoint { X = 300, Y = 300 }); await _diagram.UndoAsync(); await _diagram.RedoAsync(); // ✅ Correct — use non-async overloads _diagram.Zoom(1.2, new DiagramPoint { X = 300, Y = 300 }); _diagram.Undo(); _diagram.Redo();
⚠️
SfDiagramOverviewComponentrequires an additional@using— it lives inSyncfusion.Blazor.Diagram.Overview, NOT inSyncfusion.Blazor.Diagram. Forgetting it causesCS0246:@* ❌ Wrong — SfDiagramOverviewComponent not found without the Overview namespace *@ @using Syncfusion.Blazor.Diagram @* ✅ Correct — both namespaces required *@ @using Syncfusion.Blazor.Diagram @using Syncfusion.Blazor.Diagram.Overview
⚠️
SourceIDmust exactly match theIDset onSfDiagramComponent— theIDis NOT auto-generated; you must set it explicitly. A mismatch (including case) renders the overview empty:@* ❌ Wrong — ID not set on the diagram; SourceID has nothing to link to *@ <SfDiagramComponent Width="100%" Height="500px" Nodes="@_nodes" /> <SfDiagramOverviewComponent SourceID="myDiagram" Height="150px" /> @* ✅ Correct — ID set on diagram, SourceID matches exactly *@ <SfDiagramComponent ID="myDiagram" Width="100%" Height="500px" Nodes="@_nodes" /> <SfDiagramOverviewComponent SourceID="myDiagram" Height="150px" />
⚠️ Do NOT nest
SfDiagramOverviewComponentinsideSfDiagramComponent— the overview is a sibling component rendered outside the diagram markup.
references/advanced-features.md (opens in a new tab)references/annotations.md (opens in a new tab)references/bpmn.md (opens in a new tab)references/collaborative-editing.md (opens in a new tab)references/connectors.md (opens in a new tab)references/data-binding.md (opens in a new tab)references/events.md (opens in a new tab)references/export-print.md (opens in a new tab)references/getting-started.md (opens in a new tab)references/interaction.md (opens in a new tab)references/layout.md (opens in a new tab)references/nodes.md (opens in a new tab)references/overview-component.md (opens in a new tab)references/ports.md (opens in a new tab)references/serialization.md (opens in a new tab)references/shapes.md (opens in a new tab)references/styling.md (opens in a new tab)references/swimlane.md (opens in a new tab)references/symbol-palette.md (opens in a new tab)references/uml-class-diagram.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub syncfusion/boldcreate-plugins --plugin syncfusion-blazor69 skills in this plugin
/syncfusion-blazor-3d-chartsProvides guidance for building and customizing Syncfusion Blazor 3D Charts. Trigger this skill whenever the user needs help with SfChart3D, 3D Column/Bar charts, axes, data binding, rotation, tilt, depth, legends, tooltips, or any configuration in Syncfusion.Blazor.Chart3D./syncfusion-blazor-accordionGuide for implementing the Syncfusion Blazor Accordion component for creating collapsible panels with expandable content. Use this skill when users need to build accordions, implement collapsible sections, create expandable panels, organize content in navigation components, implement FAQs, build collapsible menus, add nested accordions, configure expand modes (single or multiple), handle accordion events, customize accordion styling, implement accessible accordions with WCAG compliance, integrate data binding, or work with any vertically collapsible content containers in Blazor applications./syncfusion-blazor-accumulation-chartImplement Syncfusion Blazor Accumulation Chart (SfAccumulationChart) for proportional data visualization. Use this when creating pie charts, doughnut charts, funnel charts, or pyramid charts. This skill covers data labels, legends, tooltips, slice grouping, and part-to-whole visualizations in Blazor applications./syncfusion-blazor-ai-assistviewImplement the Syncfusion Blazor AI AssistView component for AI-powered chat interfaces in Blazor applications. Use this skill when implementing conversational AI, chatbots, AI assistants, or prompt-response interfaces. Covers AssistViewPrompt setup, PromptRequested events, markdown responses, prompt suggestions with avatar customization, and speech recognition/synthesis for voice-enabled chat interactions./syncfusion-blazor-appbarGuide for implementing Syncfusion Blazor AppBar component (SfAppBar) in Blazor applications. Use this when implementing navigation bars, app bars, or header toolbars with action controls. This skill covers AppBar configuration, size modes (regular, prominent, dense), color modes, positioning (top, bottom, sticky), menu integration, and responsive design patterns./syncfusion-blazor-barcodeBuild and troubleshoot barcode generation in Blazor using SfBarcodeGenerator, SfQRCodeGenerator, SfDataMatrixGenerator, and SfDotCodeGenerator. Trigger for 1D barcodes (Code39, Code128, Codabar), QR codes with logo and error correction, Data Matrix, DotCode, GS1-compliant symbologies (GS1 Code 128, ITF-14, GS1 DataBar family, GS1 QR Code, GS1 Data Matrix, GS1 DotCode) for retail/logistics/inventory traceability, checksum validation, and exporting barcodes to images in Syncfusion Blazor apps.