ShadyNagy.Blazor.JavaScriptUtilities 1.0.5

.NET Standard 2.1
There is a newer version of this package available.
See the version list below for details.
dotnet add package ShadyNagy.Blazor.JavaScriptUtilities --version 1.0.5
NuGet\Install-Package ShadyNagy.Blazor.JavaScriptUtilities -Version 1.0.5
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="ShadyNagy.Blazor.JavaScriptUtilities" Version="1.0.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ShadyNagy.Blazor.JavaScriptUtilities --version 1.0.5
#r "nuget: ShadyNagy.Blazor.JavaScriptUtilities, 1.0.5"
#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.
// Install ShadyNagy.Blazor.JavaScriptUtilities as a Cake Addin
#addin nuget:?package=ShadyNagy.Blazor.JavaScriptUtilities&version=1.0.5

// Install ShadyNagy.Blazor.JavaScriptUtilities as a Cake Tool
#tool nuget:?package=ShadyNagy.Blazor.JavaScriptUtilities&version=1.0.5


Utilities by JavaScript for Blazor (Scroll Hide, Scroll Show, Cookie Read, Cookie Delete, ...... and more comming).


Give a Star!

If you like or are using this project please give it a star. Thanks!

Getting Setup

You can install the package via the nuget package manager just search for ShadyNagy.Blazor.. You can also install via powershell using the following command.

Install-Package ShadyNagy.Blazor.JavaScriptUtilities

Or via the dotnet CLI.

dotnet add package ShadyNagy.Blazor.JavaScriptUtilities

1. Register Services

For Blazor WebAssembly: You will need to add the following using statement and add a call to register the Blazor JavaScript Utilities services in your applications Program.Main method.

using ShadyNagy.Blazor.JavaScriptUtilities;

public static async Task Main(string[] args)

Also you can register what you need only ex


For Blazor Server: You will need to add the following using statement and add a call to register the Blazor JavaScript Utilities services in your applications Startup.ConfigureServices method.

using ShadyNagy.Blazor.JavaScriptUtilities;

public void ConfigureServices(IServiceCollection services)

Also you can register what you need only ex


2. Add reference to style sheet & javascript reference

Add the following line to the head tag of your _Host.cshtml (Blazor Server) or index.html (Blazor WebAssembly).

<link rel="stylesheet" href="_content/ShadyNagy.Blazor.JavaScriptUtilities/blazor-javascript-utilities.min.css" />

Then add a reference to the Blazor Utilities JavaScript file at the bottom of the respective page after the reference to the Blazor file before </body>.

<script src="_content/ShadyNagy.Blazor.JavaScriptUtilities/blazor-javascript-utilities-min.js" type="text/javascript" language="javascript"></script>

3. Add Imports

Add the following to your _Imports.razor

@using ShadyNagy.Blazor.JavaScriptUtilities
@using ShadyNagy.Blazor.JavaScriptUtilities.Services
@using ShadyNagy.Blazor.JavaScriptUtilities.Constants

4. Add Injects

@inject IBlazorScrollController BlazorScrollController
@inject IBlazorCookie BlazorCookie

5. Examples

To hide both scrolls

await BlazorScrollController.HideBodyScrollOverflowAsync(ScrollType.Both);


Please checkout the sample projects in this repo to see working examples of the features in the Blazor JavaScript Utilities.

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.1
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
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.9 444 8/7/2020
1.0.8 375 8/3/2020
1.0.7 345 8/2/2020
1.0.6 354 8/2/2020
1.0.5 351 8/1/2020
1.0.4 369 8/1/2020
1.0.3 299 8/1/2020
1.0.2 342 7/31/2020
1.0.1 340 7/31/2020
1.0.0 334 7/31/2020

One js file added.