BlazorSpinner 3.0.0

dotnet add package BlazorSpinner --version 3.0.0                
NuGet\Install-Package BlazorSpinner -Version 3.0.0                
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="BlazorSpinner" Version="3.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add BlazorSpinner --version 3.0.0                
#r "nuget: BlazorSpinner, 3.0.0"                
#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 BlazorSpinner as a Cake Addin
#addin nuget:?package=BlazorSpinner&version=3.0.0

// Install BlazorSpinner as a Cake Tool
#tool nuget:?package=BlazorSpinner&version=3.0.0                

.NET CI/CD Nuget Azure Static Web Apps CI/CD

BlazorSpinner

BlazorSpinner is a loading spinner that can be included in Blazor applications. It has a simple service that can be called to "show" or "hide" the spinner.

Demo

Demo link: https://red-bay-06d0ccf10.1.azurestaticapps.net

This is a screen shot of the spinner Screen Shot

Basic Setup

Review the demo project for details on how to implement the spinner.

  1. Install the library from Nuget: https://www.nuget.org/packages/BlazorSpinner/
  2. Add "@using BlazorSpinner" in your _Imports.razor
  3. Add "builder.Services.AddScoped<SpinnerService>();" in your Program.cs file
  4. Add "<Spinner></Spinner>" to your MainLayout.razor file
  5. On any page you want to call the spinner from, inject the SpinnerService into it: @inject BlazorSpinner.SpinnerService _spinnerService
  6. Call _spinnerService.Show() or _spinnerService.Hide() to "Show" or "Hide" the spinner.

Call the spinner on any long-running calls or processes (such as API calls).

Customizing Loading Icon

You can use your own SVG for the loading icon, instead of the default spinner.

  1. Copy your SVG file into the 'wwwroot' of your application.
  2. In the MainLayout.razor, set the 'Type' parameter to 'SpinnerType.Icon' for the Spinner component.
  3. In the MainLayout.razor, set the 'Icon' parameter to the path to your SVG file.
  4. Example:
    <Spinner Type="@SpinnerType.Icon" Icon="loading.svg"></Spinner>
    

Customizing Loading Text

You can use your own SVG for the loading icon, instead of the default spinner.

  1. In the MainLayout.razor, set the 'Type' parameter to 'SpinnerType.Text' for the Spinner component.
  2. In the MainLayout.razor, set the 'Text' parameter to the text you want
  3. Example:
    <Spinner Type="@SpinnerType.Text" Text="Processing...""></Spinner>
    

v2 ⇒ v3 Breaking Changes

The 'Loading' component and service have been merged with the 'Spinner' componet and service. Applications that have previously used the 'Loading' component and service need to be updated to use the 'Spinner' component and service.

Icon Source

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
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
3.0.0 1,928 8/22/2024
2.1.0 6,433 3/20/2024
2.0.0 320 3/13/2024
1.5.0 2,739 2/4/2024
1.4.2 8,856 7/17/2023
1.4.1 3,781 2/27/2023
1.4.0 507 2/27/2023
1.3.0 30,641 3/9/2022
1.2.0 5,393 11/26/2021
1.1.0 34,210 2/15/2021

v3.0.0: Customize loading icon and customize loading text.