Bielu.AspNetCore.LikeC4.Scalar
3.4.0
Prefix Reserved
dotnet add package Bielu.AspNetCore.LikeC4.Scalar --version 3.4.0
NuGet\Install-Package Bielu.AspNetCore.LikeC4.Scalar -Version 3.4.0
<PackageReference Include="Bielu.AspNetCore.LikeC4.Scalar" Version="3.4.0" />
<PackageVersion Include="Bielu.AspNetCore.LikeC4.Scalar" Version="3.4.0" />
<PackageReference Include="Bielu.AspNetCore.LikeC4.Scalar" />
paket add Bielu.AspNetCore.LikeC4.Scalar --version 3.4.0
#r "nuget: Bielu.AspNetCore.LikeC4.Scalar, 3.4.0"
#:package Bielu.AspNetCore.LikeC4.Scalar@3.4.0
#addin nuget:?package=Bielu.AspNetCore.LikeC4.Scalar&version=3.4.0
#tool nuget:?package=Bielu.AspNetCore.LikeC4.Scalar&version=3.4.0
Bielu.AspNetCore.LikeC4.Scalar
Draws the views of a LikeC4 architecture model in the Scalar API Reference in ASP.NET Core, next to the API documents they describe. Each view gets a sidebar entry and is drawn as LikeC4 laid it out, in Scalar's theme. Dynamic views can be drawn as sequence diagrams, and an element or step that opens another view links to it.
Installation
dotnet add package Bielu.AspNetCore.LikeC4.Scalar
dotnet add package Scalar.AspNetCore
Usage
Export the model, already laid out, to a file the app serves:
npx likec4 export json -o wwwroot/architecture.likec4.json architecture
app.MapStaticAssets(); // serves wwwroot/architecture.likec4.json
app.MapScalarLikeC4Assets();
app.MapScalarApiReference(options =>
{
options.AddAsyncApiDocument("v1", "Events"); // the API documents the model describes
options.AddLikeC4Document("architecture", "Architecture"); // /{documentName}.likec4.json by default
options.WithLikeC4();
});
From a custom path
routePattern: sets the URL the model is fetched from; {documentName} in it is replaced with the model's name.
Serve the file at that URL however you like, and give MapScalarLikeC4Assets and WithLikeC4 the same path to
move the plugin bundle:
// architecture/architecture.json, in the project folder, served at /docs/architecture.json
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(Path.Combine(app.Environment.ContentRootPath, "architecture")),
RequestPath = "/docs",
});
app.MapScalarLikeC4Assets("/assets/likec4");
app.MapScalarApiReference(options => options
.AddLikeC4Document("architecture", "Architecture", routePattern: "/docs/{documentName}.json")
.WithLikeC4("/assets/likec4"));
Requires
Scalar.AspNetCore3.0.1 or later, the first release bundling plugin document types (@scalar/api-reference1.80.0, scalar/scalar#10816).
For the Scalar resource of a .NET Aspire AppHost, use Bielu.AspNetCore.LikeC4.Scalar.Aspire.
Documentation
Copyright (c) 2025 Arkadiusz Biel. Released under the MIT license.
| 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. net11.0 is compatible. |
-
net10.0
- Bielu.AspNetCore.AsyncApi.Scalar (>= 3.4.0)
- Scalar.AspNetCore (>= 3.0.1)
-
net11.0
- Bielu.AspNetCore.AsyncApi.Scalar (>= 3.4.0)
- Scalar.AspNetCore (>= 3.0.1)
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 |
|---|---|---|
| 3.4.0 | 44 | 11/29/2026 |
| 3.4.0-beta.20261129131534 | 35 | 11/29/2026 |
| 3.4.0-beta.20261129131529 | 38 | 11/29/2026 |
| 3.4.0-beta.20261129131234 | 33 | 11/29/2026 |
| 3.4.0-beta.20261129125539 | 40 | 11/29/2026 |
| 3.4.0-beta.20261129105511 | 44 | 11/29/2026 |