![]() |
VOOZH | about |
dotnet add package Soenneker.Blazor.Utils.ResourceLoader --version 4.0.1676
NuGet\Install-Package Soenneker.Blazor.Utils.ResourceLoader -Version 4.0.1676
<PackageReference Include="Soenneker.Blazor.Utils.ResourceLoader" Version="4.0.1676" />
<PackageVersion Include="Soenneker.Blazor.Utils.ResourceLoader" Version="4.0.1676" />Directory.Packages.props
<PackageReference Include="Soenneker.Blazor.Utils.ResourceLoader" />Project file
paket add Soenneker.Blazor.Utils.ResourceLoader --version 4.0.1676
#r "nuget: Soenneker.Blazor.Utils.ResourceLoader, 4.0.1676"
#:package Soenneker.Blazor.Utils.ResourceLoader@4.0.1676
#addin nuget:?package=Soenneker.Blazor.Utils.ResourceLoader&version=4.0.1676Install as a Cake Addin
#tool nuget:?package=Soenneker.Blazor.Utils.ResourceLoader&version=4.0.1676Install 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
The ResourceLoader class is designed to manage the loading and initialization of scripts, styles, and JavaScript modules in a Blazor application. It provides methods to asynchronously load scripts and styles, wait for variables to be available, and manage the lifecycle of JavaScript modules.
It ensures that each resource is only loaded once (through this interop), even with multiple concurrent calls.
dotnet add package Soenneker.Blazor.Utils.ResourceLoader
To load a script, use the LoadScript method. It injects the file into the DOM.
await resourceLoader.LoadScript("https://example.com/script.js");
LoadScriptAndWaitForVariable is also available as a legacy fallback for third-party scripts that expose globals instead of ES module exports:
await resourceLoader.LoadScriptAndWaitForVariable("https://example.com/script.js", "variableName");
To load an ES module script tag, use LoadModuleScript:
await resourceLoader.LoadModuleScript("https://example.com/module.js");
If that module assigns a global and you need to wait for it, use:
await resourceLoader.LoadModuleScriptAndWaitForVariable("https://example.com/module.js", "myGlobal");
To load a style, use the LoadStyle method. It injects the file into the DOM.
await resourceLoader.LoadStyle("https://example.com/style.css");
To import a JavaScript module, use the ImportModule method:
var module = await resourceLoader.ImportModule("moduleName");
ImportModule already waits for the ES module import to complete, so Soenneker-owned interops should import the module directly and invoke its exports.
To import an external ES module by absolute URI, use ImportExternalModule:
var module = await resourceLoader.ImportExternalModule("https://cdn.jsdelivr.net/npm/some-package/+esm");
This is useful for ESM-first libraries that do not expose browser globals.
To wait for a JavaScript global to be available, use the WaitForVariable method:
await resourceLoader.WaitForVariable("variableName");
Be sure to dispose of a module after you're done interacting with it. To dispose of a JavaScript module, use the DisposeModule method:
await resourceLoader.DisposeModule("moduleName");
External modules imported by URL can also be disposed:
await resourceLoader.DisposeExternalModule("https://cdn.jsdelivr.net/npm/some-package/+esm");
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 5 NuGet packages that depend on Soenneker.Blazor.Utils.ResourceLoader:
| Package | Downloads |
|---|---|
|
Soenneker.Blazor.TomSelect
A Blazor interop library for the select user control library, Tom Select |
|
|
Soenneker.Blazor.FilePond
A Blazor interop library for the file upload library FilePond |
|
|
Soenneker.Blazor.Masonry
A lightweight, responsive Blazor component for Masonry (the cascading grid layout library) — perfect for image grids, cards, and dynamic content. |
|
|
Soenneker.Blazor.Turnstile
A Blazor interop library for Cloudflare Turnstile |
|
|
Soenneker.Blazor.DataTables
A Blazor interop library for DataTables |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.1676 | 0 | 6/18/2026 |
| 4.0.1675 | 595 | 6/17/2026 |
| 4.0.1674 | 3,832 | 6/10/2026 |
| 4.0.1673 | 2,486 | 6/9/2026 |
| 4.0.1672 | 3,973 | 6/7/2026 |
| 4.0.1671 | 1,119 | 6/6/2026 |
| 4.0.1670 | 358 | 6/6/2026 |
| 4.0.1669 | 336 | 6/6/2026 |
| 4.0.1668 | 921 | 6/6/2026 |
| 4.0.1667 | 123 | 6/6/2026 |
| 4.0.1666 | 294 | 6/5/2026 |
| 4.0.1665 | 422 | 6/5/2026 |
| 4.0.1664 | 545 | 6/5/2026 |
| 4.0.1663 | 101 | 6/5/2026 |
| 4.0.1662 | 8,750 | 5/13/2026 |
| 4.0.1661 | 1,299 | 5/12/2026 |
| 4.0.1660 | 6,643 | 5/2/2026 |
| 4.0.1659 | 5,143 | 4/24/2026 |
| 4.0.1658 | 760 | 4/24/2026 |
| 4.0.1657 | 776 | 4/23/2026 |
Update actions/checkout action to v7 (#2114)