BlueBlazor 1.1.2
See the version list below for details.
dotnet add package BlueBlazor --version 1.1.2
NuGet\Install-Package BlueBlazor -Version 1.1.2
<PackageReference Include="BlueBlazor" Version="1.1.2" />
paket add BlueBlazor --version 1.1.2
#r "nuget: BlueBlazor, 1.1.2"
// Install BlueBlazor as a Cake Addin #addin nuget:?package=BlueBlazor&version=1.1.2 // Install BlueBlazor as a Cake Tool #tool nuget:?package=BlueBlazor&version=1.1.2
Blue Blazor
Blue Blazor is an adaptation of Blue Web for Blazor.
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/css/blue-web.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/css/blue-web.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/css/blue-web.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.