Substantive.Blazor.CustomElements 9.4.0-build20260114r1

Substantive.Blazor.CustomElements

Utility helpers that make it easier to discover and register Blazor components as HTML custom elements using the Microsoft.AspNetCore.Components.CustomElements package.

Getting started

  1. Decorate components that should be exposed as custom elements using the [BlazorCustomElement] attribute:
    @attribute [BlazorCustomElement("status-indicator")]
    <span class="status">@Message</span>
    @code {
        [Parameter] public string? Message { get; set; }
    }
    
  2. Compose a CustomElementCollection in your host, then register every definition with the builder's RootComponents:
    using Substantive.Blazor.CustomElements;
    
    var builder = WebAssemblyHostBuilder.CreateDefault(args);
    var elements = new CustomElementCollection()
        .DiscoverFromAssembly(typeof(StatusBadge).Assembly)
        .Register<Counter>("counter-widget");
    
    builder.RootComponents.RegisterCustomElements(elements);
    await builder.Build().RunAsync();
    

The collection validates tag names, prevents duplicate registrations, and supports assembly scanning so that large solutions can organise custom elements declaratively.

Sample component

The Substantive.DevTools.Blazor package ships a CustomElements/StatusIndicator.razor sample that demonstrates how to ship a polished custom element from a Razor class library:

@namespace Substantive.DevTools.Blazor.CustomElements
@attribute [BlazorCustomElement("status-indicator")]

<div class="status-indicator" role="status">
    <span class="status-indicator__dot" style="background-color:@DotColor"></span>
    <span>@Message</span>
</div>

You can register it using the discovery helpers:

var elements = new CustomElementCollection()
    .DiscoverFromAssembly(typeof(Substantive.DevTools.Blazor.CustomElements.StatusIndicator).Assembly);

builder.RootComponents.RegisterCustomElements(elements);

Showing the top 20 packages that depend on Substantive.Blazor.CustomElements.

Packages Downloads
Substantive.DevTools.Blazor
Substantive Blazor development tools.
9
Substantive.DevTools.Blazor
Substantive Blazor development tools.
10
Substantive.DevTools.Blazor
Substantive Blazor development tools.
11
Substantive.DevTools.Blazor
Substantive Blazor development tools.
12
Substantive.DevTools.Blazor
Substantive Blazor development tools.
21
Substantive.DevTools.Blazor
Substantive Blazor development tools.
24

Version Downloads Last updated
9.4.0-build20260625R1 22 06/25/2026
9.4.0-build20260427R7 24 04/27/2026
9.4.0-build20260427R6 10 04/27/2026
9.4.0-build20260424R5 10 04/24/2026
9.4.0-build20260424R4 9 04/24/2026
9.4.0-build20260424R3 9 04/24/2026
9.4.0-build20260424R2 9 04/24/2026
9.4.0-build20260424R1 9 04/24/2026
9.4.0-build20260422R1 9 04/22/2026
9.4.0-build20260421R9 11 04/21/2026
9.4.0-build20260421R8 8 04/21/2026
9.4.0-build20260421R6 9 04/21/2026
9.4.0-build20260421R5 9 04/21/2026
9.4.0-build20260421R4 10 04/21/2026
9.4.0-build20260421R16 8 04/21/2026
9.4.0-build20260421R15 9 04/21/2026
9.4.0-build20260421R14 8 04/21/2026
9.4.0-build20260421R12 8 04/21/2026
9.4.0-build20260421R11 9 04/21/2026
9.4.0-build20260421R10 8 04/21/2026
9.4.0-build20260420R3 9 04/20/2026
9.4.0-build20260420R2 9 04/20/2026
9.4.0-build20260414R2 11 04/14/2026
9.4.0-build20260414R1 10 04/14/2026
9.4.0-build20260410R1 11 04/10/2026
9.4.0-build20260408R1 9 04/08/2026
9.4.0-build20260407R1 10 04/07/2026
9.4.0-build20260403R7 10 04/03/2026
9.4.0-build20260403R6 8 04/03/2026
9.4.0-build20260403R5 8 04/03/2026
9.4.0-build20260401R5 11 04/01/2026
9.4.0-build20260401R4 9 04/01/2026
9.4.0-build20260401R3 8 04/01/2026
9.4.0-build20260401R2 9 04/01/2026
9.4.0-build20260401R1 9 04/01/2026
9.4.0-build20260331R7 9 03/31/2026
9.4.0-build20260331R6 9 03/31/2026
9.4.0-build20260331R5 9 03/31/2026
9.4.0-build20260331R4 9 03/31/2026
9.4.0-build20260331R3 8 03/31/2026
9.4.0-build20260331R2 8 03/31/2026
9.4.0-build20260331R1 9 03/31/2026
9.4.0-build20260330R4 10 03/30/2026
9.4.0-build20260330R3 10 03/30/2026
9.4.0-build20260329R1 9 03/29/2026
9.4.0-build20260318R3 10 03/18/2026
9.4.0-build20260317R2 8 03/17/2026
9.4.0-build20260207R3 11 02/07/2026
9.4.0-build20260207R2 7 02/07/2026
9.4.0-build20260206R6 9 02/06/2026
9.4.0-build20260206R5 8 02/06/2026
9.4.0-build20260206R4 8 02/06/2026
9.4.0-build20260206R3 8 02/06/2026
9.4.0-build20260206R2 8 02/06/2026
9.4.0-build20260202R1 10 02/02/2026
9.4.0-build20260115R1 12 01/15/2026
9.4.0-build20260114R5 9 01/14/2026
9.4.0-build20260114R4 8 01/14/2026
9.4.0-build20260114R1 9 01/14/2026
9.4.0-build20260113R3 10 01/13/2026
9.4.0-build20260113R2 8 01/13/2026
9.4.0-build20260113R1 9 01/13/2026
9.4.0-build20260109R1 9 01/09/2026