Beck 0.6.0

dotnet add package Beck --version 0.6.0
                    
NuGet\Install-Package Beck -Version 0.6.0
                    
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="Beck" Version="0.6.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Beck" Version="0.6.0" />
                    
Directory.Packages.props
<PackageReference Include="Beck" />
                    
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 Beck --version 0.6.0
                    
#r "nuget: Beck, 0.6.0"
                    
#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 Beck@0.6.0
                    
#: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=Beck&version=0.6.0
                    
Install as a Cake Addin
#tool nuget:?package=Beck&version=0.6.0
                    
Install as a Cake Tool

Beck

Declarative, animated diagrams from YAML — architecture, sequence, state, and class — rendered entirely server-side in C# for .NET docs and apps.

BeckSvg.Render(yaml) turns a small YAML document into a single self-contained, self-animating inline <svg>. Layout, edge routing, theming, and the full flow choreography (packets, trails, highlights, narration captions) are baked into CSS animations inside the SVG — no client JavaScript, no runtime, nothing to hydrate. Diagrams respect prefers-reduced-motion and adopt the host page's palette and dark mode through CSS variables.

This package ships two things:

  1. The rendering engine (Beck.Rendering namespace) — BeckSvg.Render(yaml, options).
  2. The authoring API (Beck namespace) — a dependency-free fluent builder family for emitting Beck YAML from code, so any program can turn its own model into a diagram.

Render a diagram

using Beck.Rendering;

string svg = BeckSvg.Render("""
    type: architecture
    meta: { title: Request Path }
    nodes:
      - { id: client, title: Browser, kind: user }
      - { id: api, title: API Server }
      - { id: db, title: Postgres, kind: db }
    edges:
      - { from: client, to: api }
      - { from: api, to: db, label: query }
    """);

Write the string into any page you produce — a Razor view (@((MarkupString)svg)), a minimal-API endpoint, or a static-site build step. The root type: picks the diagram kind — architecture, sequence (participants + messages), state (states + transitions), or class (classes + relations) — all sharing the same theming, animation, and options.

SvgRenderOptions controls the render: Animation (Full, Static, or Scrub — scroll-driven), Theme (pin light/dark or emit both hooks), Measurer/Font (see below), Style/Styles (see below), and EmbedFonts.

Styles

A style is a complete visual identity — shapes, strokes, typography, colour bias, and motion — chosen with a single token. Beck ships nine (classic the default, plus minimal, terminal, blueprint, glow, brutalist, sketch, extrude, circuit). A style only redefines the defaults of the --beck-* tokens, so a themed diagram still adopts the host palette and flips with light and dark. Select one per document with meta: { style: sketch }, or set a site-wide default from C#:

string svg = BeckSvg.Render(yaml, new SvgRenderOptions { Style = BeckStyles.Glow });

Precedence runs meta.styleSvgRenderOptions.Styleclassic. Every built-in is an instance of the public BeckStyle record; derive your own with a with expression and register it in SvgRenderOptions.Styles so a document's meta.style can name it.

Text measurement

Beck sizes every card to its text. Out of the box it measures with an embedded Inter + IBM Plex Mono metrics table — zero configuration, no native dependencies. For pixel-exact sizing in your site's own fonts, add the Beck.Skia package and pass a SkiaTextMeasurer pointed at the same font files your CSS serves:

using Beck.Rendering;
using Beck.Rendering.Text;
using Beck.Skia;

var font = new BeckFontSpec
{
    Family = "IBM Plex Sans",
    Files = new Dictionary<int, string> { [400] = "fonts/IBMPlexSans-Regular.ttf" /* … */ },
};
using var measurer = new SkiaTextMeasurer(font);
string svg = BeckSvg.Render(yaml, new SvgRenderOptions { Measurer = measurer, Font = font });

Authoring from code

using Beck;

string yaml = new DiagramBuilder("Web Platform")
    .Direction(Direction.TB)
    .Node("web", n => n.Title("Web App").Kind(NodeKind.User))
    .Node("gw", n => n.Title("API Gateway").Kind(NodeKind.Gateway))
    .Node("auth", "Auth Service")
    .Node("authdb", n => n.Title("Auth DB").Kind(NodeKind.Db))
    .Group("services", g => g.Label("Services").Members("auth").Accent(AccentToken.Primary))
    .Edge("web", "gw")
    .Edge("gw", "auth")
    .Edge("auth", "authdb", e => e.Label("reads"))
    .ToYaml();

string svg = BeckSvg.Render(yaml);

Use .ToYaml() for the raw YAML, or .ToFence() for a Markdown ```beck code block. Because the emitter is free of any framework or diagram dependency, the natural pattern is to walk any source — an Aspire app graph, an EF model, a service registry — into a DiagramBuilder and render it.

Each diagram type has its own builder — SequenceDiagramBuilder, StateDiagramBuilder, and ClassDiagramBuilder — and the class builder can reflect an always-current domain model straight from your types:

string yaml = ClassDiagramBuilder
    .FromTypes(typeof(Order), typeof(OrderLine), typeof(Customer))
    .Title("Order Model")
    .ToYaml();

Docs and schema

Full guides, the YAML schema reference, and a live playground: https://usepennington.github.io/beck/

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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 (2)

Showing the top 2 NuGet packages that depend on Beck:

Package Downloads
Pennington.Beck

Build-time Beck diagram rendering for Pennington — ```beck fences become self-animating inline SVG

Beck.Skia

Exact text measurement for Beck using SkiaSharp + HarfBuzzSharp shaping. Optional plug-in: supply your own font files and diagrams size to the real glyph metrics instead of the embedded Inter fallback table.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.6.0 161 7/12/2026
0.5.0 343 7/10/2026
0.4.5 153 7/10/2026
0.4.4 140 7/10/2026
0.4.3 139 7/10/2026
0.4.2 138 7/10/2026
0.4.1 135 7/10/2026
0.4.0 131 7/9/2026
0.3.0 150 7/6/2026
0.2.1 113 7/5/2026
0.2.0 110 7/5/2026
0.1.0 212 6/19/2026