Soenneker.Blazor.Utils.ModuleImport 3.0.1592

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Blazor.Utils.ModuleImport --version 3.0.1592
                    
NuGet\Install-Package Soenneker.Blazor.Utils.ModuleImport -Version 3.0.1592
                    
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="Soenneker.Blazor.Utils.ModuleImport" Version="3.0.1592" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Blazor.Utils.ModuleImport" Version="3.0.1592" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Blazor.Utils.ModuleImport" />
                    
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 Soenneker.Blazor.Utils.ModuleImport --version 3.0.1592
                    
#r "nuget: Soenneker.Blazor.Utils.ModuleImport, 3.0.1592"
                    
#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 Soenneker.Blazor.Utils.ModuleImport@3.0.1592
                    
#: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=Soenneker.Blazor.Utils.ModuleImport&version=3.0.1592
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Blazor.Utils.ModuleImport&version=3.0.1592
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

alternate text is missing from this package README image Soenneker.Blazor.Utils.ModuleImport

A Blazor utility library assisting with asynchronous module loading

This library simplifies the process of loading JavaScript modules and provides methods for waiting until a module is loaded and disposing of modules when they are no longer needed.

Features

  • Import JavaScript modules dynamically.
  • Wait until a module is fully loaded.
  • Dispose of JavaScript modules when they are no longer needed.
  • Singleton pattern to ensure that each module is loaded only once.

Installation

To install, add the package to your Blazor project using the .NET CLI:

dotnet add package Soenneker.Blazor.Utils.ModuleImport

Register it in DI:

builder.Services.AddModuleImportUtil();

Example

Here's an example of how to use the ModuleImportUtil in a Blazor component:

@page "/example"
@inject IModuleImportUtil ModuleImportUtil
@implements IAsyncDisposable

<h3>Module Import Example</h3>

<button @onclick="LoadModule">Load Module</button>

@code {
    private async Task LoadModule()
    {
        var module = await ModuleImportUtil.Import("exampleModule");
        await ModuleImportUtil.WaitUntilLoaded("exampleModule");

        // Guaranteed that the module has been added to the DOM, and available at this point
    }

    public async ValueTask DisposeAsync()
    {
        await ModuleImportUtil.DisposeModule("exampleModule");
    }
}
Product Compatible and additional computed target framework versions.
.NET 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 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 (1)

Showing the top 1 NuGet packages that depend on Soenneker.Blazor.Utils.ModuleImport:

Package Downloads
Soenneker.Blazor.Utils.ResourceLoader

A Blazor JavaScript interop for dynamically loading scripts, styles, and modules

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.1731 49 2/12/2026
4.0.1730 264 2/12/2026
4.0.1729 49 2/12/2026
4.0.1728 585 2/11/2026
4.0.1727 572 2/10/2026
4.0.1726 801 2/10/2026
4.0.1725 1,639 2/6/2026
4.0.1724 424 2/6/2026
4.0.1723 2,683 1/27/2026
4.0.1722 307 1/26/2026
4.0.1721 94 1/26/2026
4.0.1720 91 1/26/2026
4.0.1719 1,701 1/23/2026
4.0.1718 357 1/22/2026
4.0.1717 563 1/22/2026
4.0.1716 91 1/22/2026
4.0.1715 970 1/21/2026
4.0.1714 473 1/20/2026
4.0.1713 1,903 1/14/2026
3.0.1592 570 5/18/2025
Loading failed