Skip to main content
net10.0

Blazor components for sections whose final UI depends on setup contributed by child components. A smaller, section-level alternative to Cold Rendering when you want to stay inside normal Blazor rendering.

Published
Apr 6, 2026
6mo ago
Total Downloads
93
93

Install

dotnet add package Tenekon.Extensions.Blazor.Prelude --version 1.0.1-alpha
ProductVersions
.NET
net10.0

README

Tenekon.Extensions.Blazor.Prelude

GitHub .NET Blazor

Prelude helps a parent component wait for child components before rendering a section's final UI.

Use it when the parent owns the final markup, but child components contribute links, wrappers, attributes, or delayed state needed to build that markup.

What Problem It Solves

Sometimes the parent component is responsible for the visible section, but it cannot render that section correctly until child components have finished contributing setup information.

Prelude gives that pattern a direct shape:

  1. child components contribute setup information
  2. Prelude waits until that setup is finished
  3. the parent renders the final section from the completed result

This is useful for menus assembled from contributed actions, panels with contributed wrappers, reusable headers, and small delayed status surfaces.

If normal parameters and ordinary child content are already enough, you do not need Prelude.

Installation

dotnet add package Tenekon.Extensions.Blazor.Prelude
@using Tenekon.Extensions.Blazor.Prelude

Quick Example

In this simplified example, ProfileMenu owns the menu markup. ProfileHeader contributes the links.

ProfileMenu.razor

@using Microsoft.AspNetCore.Components
@using Tenekon.Extensions.Blazor.Prelude

<PreludeSection Value="_menu"
                Prelude="MenuLinks">
    <nav class="profile-menu" aria-label="Profile menu">
        @foreach (var item in _menu.Items) {
            <a href="@item.Href">@item.Label</a>
        }
    </nav>
</PreludeSection>

@code {
    private readonly MenuLinkCollection _menu = new();

    [Parameter]
    public RenderFragment? MenuLinks { get; set; }
}

ProfileHeader.razor

@using Microsoft.AspNetCore.Components.Rendering

<ProfileMenu MenuLinks="ContributeMenuLinks" />

@code {
    private void ContributeMenuLinks(RenderTreeBuilder __builder)
    {
        <MenuLinkContributor Label="Edit profile" Href="/profile/edit" />
        <MenuLinkContributor Label="Security" Href="/profile/security" />
    }
}

The important part is the split:

  • ProfileMenu owns the shared state and the final markup
  • child components contribute to that state during the prelude
  • the menu renders only after that state is ready

The omitted MenuLinkCollection and MenuLinkContributor are just the small support types around that pattern. The full runnable version is in Recipe 1.

When Prelude Fits

Prelude coordinates one section inside normal Blazor rendering.

Use it when:

  • a parent owns the final markup for a section
  • child components provide part of the information needed for that markup
  • the section should wait until that setup work is finished

Do not use it when:

  • normal parameters and child content are already enough
  • the problem is global application state or page-wide orchestration
  • the delayed work is hidden inside unrelated third-party components

Which Type Should I Use?

Type Use it when
PreludeSection<TValue> A parent should wait for shared section state before rendering the final content.
DeferredPreludeBase A prelude component needs to add more prelude work in a later pass.
CooperativePreludeBase A prelude component has delayed or asynchronous work, and the section must keep waiting for it.
ContentDelay You need to tell Prelude when that delayed work is really finished.

Most consumers start with PreludeSection<TValue>.

Cookbook

Use the cookbook for full runnable examples and broader patterns:

  • Recipe 1: collect local menu items before rendering
  • Recipe 2: let contributors wrap section-owned content
  • Recipe 3: prepare nested reusable parts together
  • Recipe 5: add more prelude work in a later pass
  • Recipe 6: wait for delayed or asynchronous work

Compatibility

  • Target framework: net10.0
  • Runtime dependency: Microsoft.AspNetCore.App
  • Additional runtime package dependencies: none

Development

git clone https://github.com/tenekon/Tenekon.Extensions.Blazor.Prelude.git
cd Tenekon.Extensions.Blazor.Prelude
dotnet test Tenekon.Extensions.Blazor.Prelude.slnx

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

This version is marked prerelease. Validate its API and upgrade path before production use.No SPDX license expression is published. Review the license text and your organisation's policy before redistribution.Compatibility metadata lists 1 target framework; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.