StatelessMermaid 1.0.3

dotnet add package StatelessMermaid --version 1.0.3
                    
NuGet\Install-Package StatelessMermaid -Version 1.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="StatelessMermaid" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="StatelessMermaid" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="StatelessMermaid" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add StatelessMermaid --version 1.0.3
                    
#r "nuget: StatelessMermaid, 1.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package StatelessMermaid@1.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=StatelessMermaid&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=StatelessMermaid&version=1.0.3
                    
Install as a Cake Tool

StatelessMermaid

NuGet codecov Build

Generates Mermaid state diagrams from Stateless state machines via a single extension method.

Installation

dotnet add package StatelessMermaid

Usage

Call ToMermaid() on any StateMachine<TState, TTrigger>:

var machine = new StateMachine<State, Trigger>(State.Offline);
// ... configure machine ...

string diagram = machine.ToMermaid();

The output is a fenced ```mermaid code block ready to embed in a Markdown document, GitHub README, or any Mermaid-compatible renderer.

Options

Pass a MermaidOptions instance to control rendering:

string diagram = machine.ToMermaid(new MermaidOptions
{
    Title = "Device Lifecycle",
    Direction = DiagramDirection.LeftToRight,
    Version = DiagramVersion.V2,
    IncludeMarkdownBlocks = true,
});
Property Type Default Description
Title string? null Adds a Mermaid front-matter title above the diagram.
Direction DiagramDirection TopToBottom Layout direction: TopToBottom, LeftToRight, RightToLeft, BottomToTop.
Version DiagramVersion V2 V2 (stateDiagram-v2, recommended) or V1 (stateDiagram). Composite states, notes, and choice nodes require V2.
IncludeMarkdownBlocks bool true Wraps output in a fenced ```mermaid block. Set to false when passing to a renderer that expects raw Mermaid syntax.

Process-wide defaults

To avoid passing options on every call, configure a default once at startup:

MermaidOptions.ConfigureDefaults(new MermaidOptions
{
    Direction = DiagramDirection.LeftToRight,
});

ConfigureDefaults returns an IDisposable that resets to the original defaults on dispose, which is useful in tests.

Provenance

Each release is published via an attested GitHub Actions build. To verify a package:

gh attestation verify <path-to-nupkg> --repo ChaseFlorell/StatelessMermaid

Full release history and attached .nupkg files are available on the GitHub Releases page.

License

MIT

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.0.3 80 5/12/2026
1.0.2 83 5/12/2026