Blazor.FlexLoader
1.3.2
See the version list below for details.
dotnet add package Blazor.FlexLoader --version 1.3.2
NuGet\Install-Package Blazor.FlexLoader -Version 1.3.2
<PackageReference Include="Blazor.FlexLoader" Version="1.3.2" />
<PackageVersion Include="Blazor.FlexLoader" Version="1.3.2" />
<PackageReference Include="Blazor.FlexLoader" />
paket add Blazor.FlexLoader --version 1.3.2
#r "nuget: Blazor.FlexLoader, 1.3.2"
#:package Blazor.FlexLoader@1.3.2
#addin nuget:?package=Blazor.FlexLoader&version=1.3.2
#tool nuget:?package=Blazor.FlexLoader&version=1.3.2
Blazor.FlexLoader
<div align="center"> <img src="./assets/icon-github.svg" alt="Blazor.FlexLoader" width="128" height="128" /> <h3>?? Un composant Blazor flexible pour les indicateurs de chargement</h3> </div>
Fran�ais
Un composant Blazor flexible et r�utilisable pour afficher des indicateurs de chargement avec support pour des images personnalis�es, du texte et du contenu custom.
?? Fonctionnalit�s
- ? Indicateur de chargement global pour les applications Blazor
- ? Support d'images personnalis�es (GIF, SVG, PNG, etc.)
- ? Texte de chargement personnalisable
- ? Contenu custom avec RenderFragment
- ? Positionnement absolu ou fixe
- ? Couleurs et styles personnalisables
- ? Fermeture automatique configurable
- ? Fermeture au clic sur l'overlay
- ? Compatible .NET 9
- ? CI/CD automatis� avec GitHub Actions
?? Installation
dotnet add package Blazor.FlexLoader
??? Configuration
1. Enregistrer le service dans Program.cs
using Blazor.FlexLoader.Extensions;
builder.Services.AddBlazorFlexLoader();
2. Ajouter les imports dans _Imports.razor
@using Blazor.FlexLoader.Components
@using Blazor.FlexLoader.Services
3. Ajouter le composant dans votre layout
<FlexLoader />
?? Utilisation
M�thodes simples Show/Close
@inject LoaderService LoaderService
<button @onclick="ShowLoader">Afficher le loader</button>
@code {
private async Task ShowLoader()
{
LoaderService.Show(); // Afficher le loader
try
{
await SomeAsyncOperation();
}
finally
{
LoaderService.Close(); // Masquer le loader
}
}
}
M�thodes Increment/Decrement (gestion avanc�e)
LoaderService.Increment(); // Compter +1
LoaderService.Decrement(); // Compter -1
LoaderService.Reset(); // Forcer fermeture
?? Param�tres du composant
| Param�tre | Type | D�faut | Description |
|---|---|---|---|
ImagePath |
string? |
null |
Chemin vers l'image de chargement |
Text |
string? |
"Chargement..." |
Texte affich� pendant le chargement |
BackgroundColor |
string |
"rgba(255,255,255,0.75)" |
Couleur de fond de l'overlay |
TextColor |
string |
"#333" |
Couleur du texte |
ImageHeight |
string? |
"120px" |
Hauteur de l'image |
UseAbsolutePosition |
bool |
true |
Position absolue ou fixe |
CustomContent |
RenderFragment? |
null |
Contenu personnalis� |
AutoClose |
bool |
true |
Fermeture automatique avec d�lai |
AutoCloseDelay |
int |
300 |
D�lai avant fermeture (ms) |
CloseOnOverlayClick |
bool |
false |
Fermer au clic sur l'overlay |
?? API du LoaderService
public class LoaderService
{
public bool IsLoading { get; }
// M�thodes simples
public void Show(); // Afficher
public void Close(); // Masquer
// M�thodes avanc�es
public void Increment(); // Compter +1
public void Decrement(); // Compter -1
public void Reset(); // Forcer fermeture
public event EventHandler? OnChange;
}
?? Licence
MIT
English
A flexible and reusable Blazor component for displaying loading indicators with support for custom images, text, and custom content.
?? Features
- ? Global loading indicator for Blazor applications
- ? Support for custom images (GIF, SVG, PNG, etc.)
- ? Customizable loading text
- ? Custom content with RenderFragment
- ? Absolute or fixed positioning
- ? Customizable colors and styles
- ? Configurable auto-close
- ? Close on overlay click
- ? Compatible with .NET 9
- ? Automated CI/CD with GitHub Actions
?? Installation
dotnet add package Blazor.FlexLoader
??? Setup
1. Register the service in Program.cs
using Blazor.FlexLoader.Extensions;
builder.Services.AddBlazorFlexLoader();
2. Add imports in _Imports.razor
@using Blazor.FlexLoader.Components
@using Blazor.FlexLoader.Services
3. Add the component to your layout
<FlexLoader />
?? Usage
Simple Show/Close methods
@inject LoaderService LoaderService
<button @onclick="ShowLoader">Show loader</button>
@code {
private async Task ShowLoader()
{
LoaderService.Show(); // Show the loader
try
{
await SomeAsyncOperation();
}
finally
{
LoaderService.Close(); // Hide the loader
}
}
}
Increment/Decrement methods (advanced management)
LoaderService.Increment(); // Count +1
LoaderService.Decrement(); // Count -1
LoaderService.Reset(); // Force close
?? Component Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
ImagePath |
string? |
null |
Path to the loading image |
Text |
string? |
"Loading..." |
Text displayed during loading |
BackgroundColor |
string |
"rgba(255,255,255,0.75)" |
Overlay background color |
TextColor |
string |
"#333" |
Text color |
ImageHeight |
string? |
"120px" |
Image height |
UseAbsolutePosition |
bool |
true |
Absolute or fixed position |
CustomContent |
RenderFragment? |
null |
Custom content |
AutoClose |
bool |
true |
Auto close with delay |
AutoCloseDelay |
int |
300 |
Delay before closing (ms) |
CloseOnOverlayClick |
bool |
false |
Close on overlay click |
?? LoaderService API
public class LoaderService
{
public bool IsLoading { get; }
// Simple methods
public void Show(); // Display
public void Close(); // Hide
// Advanced methods
public void Increment(); // Count +1
public void Decrement(); // Count -1
public void Reset(); // Force close
public event EventHandler? OnChange;
}
?? License
MIT
| Product | Versions 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. |
-
net9.0
- Microsoft.AspNetCore.Components (>= 9.0.0)
- Microsoft.AspNetCore.Components.Web (>= 9.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
v1.3.2: Fix GitHub Actions release permissions | Correction des permissions pour les releases GitHub Actions - Updated workflow permissions for GitHub releases - Fixed release creation with proper authentication - Improved CI/CD reliability