BlueBlazor 2.0.0
See the version list below for details.
dotnet add package BlueBlazor --version 2.0.0
NuGet\Install-Package BlueBlazor -Version 2.0.0
<PackageReference Include="BlueBlazor" Version="2.0.0" />
paket add BlueBlazor --version 2.0.0
#r "nuget: BlueBlazor, 2.0.0"
// Install BlueBlazor as a Cake Addin #addin nuget:?package=BlueBlazor&version=2.0.0 // Install BlueBlazor as a Cake Tool #tool nuget:?package=BlueBlazor&version=2.0.0
Blue Blazor
Blue Blazor is an adaptation of Blue Web for Blazor.
Breaking change!
The way to embed Blue Web CSS has changed. You now need to change the following line to the head of your HTML:
- <link rel="stylesheet" href="_content/BlueBlazor/css/blue-web.min.css" />
+ <link rel="stylesheet" href="_content/BlueBlazor/blue-web/style.min.css" />
Getting started
Installation
dotnet add package BlueBlazor
Import
To make use of Blue Blazor, add the following to your _Imports.razor
file:
@using BlueBlazor.Components
Register services
Register the service for localization in your Program.cs
file:
builder.Services.AddLocalization();
Stylesheet
You can use the stylesheet of Blue Web by adding the following line to the head of your HTML:
<link rel="stylesheet" href="_content/BlueBlazor/blue-web/style.min.css" />
JavaScript
Some components require JavaScript. You can embed all together:
<script src="_content/BlueBlazor/js/all.bundle.js"></script>
If you don't them all, you can also embed them individually:
<script src="_content/BlueBlazor/js/dialog.bundle.js"></script>
<script src="_content/BlueBlazor/js/modal.bundle.js"></script>
<script src="_content/BlueBlazor/js/qrCodeGen.bundle.js"></script>
<script src="_content/BlueBlazor/js/totpInput.bundle.js"></script>
Theming
You can use Themify to create custom themes. Enable "Export only CSS variables" for your theme and put the exported CSS to your project. It needs to be embedded after the Blue Blazor stylesheet:
<link rel="stylesheet" href="_content/BlueBlazor/blue-web/style.min.css" />
<link rel="stylesheet" href="css/your-theme.css" />
To support dark mode, you should create a separated theme. You can then use media queries to switch between the themes:
<link rel="stylesheet" href="_content/BlueBlazor/blue-web/style.min.css" />
<link
rel="stylesheet"
href="css/your-light-theme.css"
media="(prefers-color-scheme: light)"
/>
<link
rel="stylesheet"
href="css/your-dark-theme.css"
media="(prefers-color-scheme: dark)"
/>
JavaScript helpers
Blue Blazor provides some JavaScript helpers that aren't bound to any component. You can use them by injecting the IJSRuntime
service and calling the methods:
@inject IJSRuntime JSRuntime
@code {
async Task ask()
{
if (firstRender)
{
await JSRuntime.InvokeVoidAsync("BlueBlazor.Helpers.scrollToTop");
}
}
}
Product | Versions 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. |
-
net8.0
- Microsoft.AspNetCore.Components.Web (>= 8.0.5)
- Microsoft.Extensions.Localization (>= 8.0.6)
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.2 | 0 | 11/26/2024 |
3.0.1 | 27 | 11/25/2024 |
3.0.0 | 36 | 11/25/2024 |
2.1.1 | 90 | 10/25/2024 |
2.1.0 | 83 | 10/23/2024 |
2.0.0 | 105 | 10/10/2024 |
1.1.4 | 85 | 9/25/2024 |
1.1.3 | 87 | 9/20/2024 |
1.1.2 | 109 | 9/18/2024 |
1.1.1 | 112 | 9/5/2024 |
1.1.0 | 99 | 9/4/2024 |
1.0.5 | 145 | 8/8/2024 |
1.0.4 | 78 | 8/5/2024 |
1.0.3 | 97 | 8/1/2024 |
1.0.2 | 96 | 7/30/2024 |