BlazorSBOMViewer 1.0.4

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

Publish NuGet Package CI

BlazorSBOMViewer

A powerful, customizable Blazor component library for visualizing Software Bill of Materials (SBOM) in CycloneDX, SPDX 2.x, and SPDX 3.0 formats.

Built on MudBlazor, it provides a clean, searchable interface for packages, files, licenses, vulnerabilities, and relationships.

Features

  • Multi-Format Support:
    • CycloneDX: JSON, XML, Protobuf
    • SPDX 2.x: JSON, Tag-Value, XML, YAML, RDF/XML
    • SPDX 3.0: JSON-LD
  • Unified Entry Point: One component (SbomViewer) handles all formats with automatic detection.
  • Rich Visualization:
    • Metadata cards with creation info and timestamps.
    • Searchable tables for Components, Files, and Vulnerabilities.
    • Relationship graph views (tabular representation).
    • License expressions and URLs.
  • Flexible Input: Load from file path, raw bytes, or pre-parsed document models.
  • Themeable: Inherits your MudBlazor theme settings.
  • Cross-Platform: Works in Blazor Server, WebAssembly, and MAUI Hybrid.

Installation

dotnet add package BlazorSBOMViewer

Note: BlazorSBOMViewer requires MudBlazor.

Setup

  1. Register services in your Program.cs or MauiProgram.cs:
using BlazorSBOMViewer.Extensions;
using MudBlazor.Services;

// ...
builder.Services.AddMudServices();
builder.Services.AddBlazorSBOMViewer();
  1. Add MudBlazor resources to your HTML host (e.g., App.razor, index.html, or _Host.cshtml):
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet" />
<link href="_content/MudBlazor/MudBlazor.min.css" rel="stylesheet" />
<script src="_content/MudBlazor/MudBlazor.min.js"></script>
  1. Ensure MudThemeProvider and other providers are in your MainLayout.razor:
<MudThemeProvider />
<MudPopoverProvider />
<MudDialogProvider />
<MudSnackbarProvider />

Usage

Import the component and model namespaces once in your page or _Imports.razor:

@using BlazorSBOMViewer.Components
@using BlazorSBOMViewer.Models

Simple Usage (Auto-Detection)

<SbomViewer RawBytes="@mySbomBytes" DownloadFileName="my-app-sbom" />

From File Path (Blazor Server / MAUI)

<SbomViewer FilePath="/path/to/sbom.spdx.json" />

With Pre-Parsed Document

<SbomViewer CycloneDxDocument="@myParsedCdxDoc" />

With Source Format Override

Use SourceFormatOverride when the input is non-JSON or when you want deterministic parsing instead of auto-detection:

<SbomViewer RawBytes="@xmlBytes"
            SourceFormatOverride="SbomSourceDocumentFormat.SpdxXml"
            DownloadFileName="sbom-from-xml" />

Customizing the UI

<SbomViewer RawBytes="@bytes"
            DownloadFileName="my-app-1.0"
            DisplayOptions="@(new SbomDisplayOptions {
                ShowVulnerabilitiesTab = false,
                ShowRelationshipsTab = false,
                EnableDownloads = false,
                DefaultPageSize = 50
            })" />

Custom Error Display

Supply a RenderFragment<string> to ErrorContent to replace the default error alert:

<SbomViewer RawBytes="@bytes">
    <ErrorContent Context="msg">
        <MudAlert Severity="Severity.Warning">Could not load SBOM: @msg</MudAlert>
    </ErrorContent>
</SbomViewer>

Using Parsers Directly

The parsers are registered in DI by AddBlazorSBOMViewer() and can be injected anywhere — no Blazor component required. They return strongly-typed document objects that can be used independently of the viewer.

Namespaces

using BlazorSBOMViewer.Services;        // CycloneDxParser, SpdxParser
using BlazorSBOMViewer.Services.Spdx3;  // Spdx3Parser
using BlazorSBOMViewer.Models.CycloneDx; // CycloneDxBomDocument
using BlazorSBOMViewer.Models.Spdx;     // SpdxDocument
using BlazorSBOMViewer.Models.Spdx3;    // Spdx3Document

Inject and Parse

// Blazor component or service
@inject CycloneDxParser CycloneDxParser
@inject SpdxParser SpdxParser
@inject Spdx3Parser Spdx3Parser

// From raw bytes (format auto-detected)
CycloneDxBomDocument cdx = CycloneDxParser.Parse(fileBytes);
SpdxDocument spdx        = SpdxParser.Parse(fileBytes);
Spdx3Document spdx3      = Spdx3Parser.Parse(fileBytes);

// From a string
CycloneDxBomDocument cdx = CycloneDxParser.Parse(jsonString);
SpdxDocument spdx        = SpdxParser.Parse(tagValueString);

// From a file path (server-side only)
CycloneDxBomDocument cdx = CycloneDxParser.ParseFile("/path/to/bom.cdx.json");
SpdxDocument spdx        = SpdxParser.ParseFile("/path/to/sbom.spdx");
Spdx3Document spdx3      = Spdx3Parser.ParseFile("/path/to/sbom.spdx3.json");

// From a stream
await using var stream = File.OpenRead("/path/to/bom.cdx.xml");
CycloneDxBomDocument cdx = CycloneDxParser.Parse(stream);

Force a Specific Format

Pass an optional format enum to skip auto-detection:

// CycloneDxDocumentFormat: Json | Xml | Protobuf
CycloneDxBomDocument cdx = CycloneDxParser.Parse(bytes, CycloneDxDocumentFormat.Xml);

// SpdxDocumentFormat: Json | TagValue | Xml | Yaml | Rdf
SpdxDocument spdx = SpdxParser.Parse(bytes, SpdxDocumentFormat.Yaml);

Parser API Summary

Parser Return Type Overloads
CycloneDxParser CycloneDxBomDocument Parse(string), Parse(byte[]), Parse(Stream), ParseFile(string), DetectFormat(string/byte[])
SpdxParser SpdxDocument Parse(string), Parse(byte[]), Parse(Stream), ParseFile(string), DetectFormat(string)
Spdx3Parser Spdx3Document Parse(string), Parse(byte[]), Parse(Stream), ParseFile(string), IsSpdx3(byte[])

Example: Pipeline Without UI

// In a background service, API endpoint, or test
public class SbomAuditService(CycloneDxParser parser)
{
    public IEnumerable<string> GetLicenses(byte[] sbomBytes)
    {
        var doc = parser.Parse(sbomBytes);
        return doc.Components
            .SelectMany(c => c.Licenses)
            .Select(l => l.License?.Id ?? l.License?.Name ?? l.Expression)
            .Where(l => l is not null)
            .Distinct()!;
    }
}

Component Reference

SbomViewer Parameters

Input
Parameter Type Description
RawBytes byte[]? Raw file bytes — format is auto-detected
FilePath string? Absolute path to an SBOM file on the server (Blazor Server / MAUI only)
CycloneDxDocument CycloneDxBomDocument? Pre-parsed CycloneDX document (skips auto-detection)
SpdxDocument SpdxDocument? Pre-parsed SPDX 2.x document
Spdx3Document Spdx3Document? Pre-parsed SPDX 3.0 document

Priority order when multiple inputs are set: pre-parsed documents → RawBytesFilePath.

Format Control
Parameter Type Description
SourceFormatOverride SbomSourceDocumentFormat? Force a specific parser instead of auto-detecting

SbomSourceDocumentFormat values: CycloneDxJson, CycloneDxXml, CycloneDxProtobuf, SpdxJson, SpdxTagValue, SpdxXml, SpdxYaml, SpdxRdf, Spdx3JsonLd.

UI & Behaviour
Parameter Type Default Description
DisplayOptions SbomDisplayOptions? All enabled Controls tab visibility, search, downloads, and page size
DownloadFileName string? "sbom" Base filename (no extension) for downloaded files
ErrorContent RenderFragment<string>? Built-in alert Custom Razor template for errors; receives the error message

SbomDisplayOptions Properties

Property Type Default Effect
ShowOverviewTab bool true Show/hide the Overview tab
ShowComponentsTab bool true Show/hide the Components tab
ShowFilesTab bool true Show/hide the Files tab
ShowLicensesTab bool true Show/hide the Licenses tab
ShowVulnerabilitiesTab bool true Show/hide the Vulnerabilities tab
ShowRelationshipsTab bool true Show/hide the Relationships tab
EnableSearch bool true Enable/disable the search box in tables
EnableDownloads bool true Show/hide the download button
DefaultPageSize int 25 Rows per page in component/file tables

Download Formats

When downloads are enabled, the button offers formats matching the source document type:

Source Available Download Formats
CycloneDX JSON (.cdx.json), XML (.cdx.xml), Protobuf (.cdx.pb)
SPDX 2.x JSON (.spdx.json), Tag-Value (.spdx), XML (.spdx.xml), YAML (.spdx.yaml), RDF/XML (.spdx.rdf)
SPDX 3.0 JSON-LD (.spdx3.json)

Supported Formats

Family Formats Auto-Detect
CycloneDX JSON, XML, Protobuf Yes
SPDX 2.x JSON, Tag-Value, XML, YAML, RDF/XML Yes
SPDX 3.0 JSON-LD Yes

Limitations

  • No Conversion: The library visualizes SBOMs but does not automatically convert between format families (e.g., converting CycloneDX to SPDX).
  • MudBlazor Dependency: UI components are tightly integrated with MudBlazor.

License

MIT

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 is compatible.  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 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.4 146 4/12/2026
1.0.3 120 4/12/2026
1.0.2 124 4/11/2026