Getting Started
Follow these steps to install the library, import the namespace, add the shared styles/scripts, and make sure updates reach your users without cache hiccups.
1. Install
bit BlazorUI ships as the Bit.BlazorUI NuGet package. Install it with any of the options below:
1. Command line: run the following command to install the package:
dotnet add package Bit.BlazorUI2. Package Manager Console: execute the command below to install the package:
Install-Package Bit.BlazorUI3. Visual Studio: use the NuGet Package Manager interface to add the package.
Extra components: if you want to use the Extra components (like BitChart) you need to add the Bit.BlazorUI.Extras package:
dotnet add package Bit.BlazorUI.ExtrasInstall-Package Bit.BlazorUI.ExtrasOptional assets: if you need the asset files of the bit BlazorUI (like Segoe UI font for non-Windows clients) you need to add the Bit.BlazorUI.Assets package:
dotnet add package Bit.BlazorUI.AssetsInstall-Package Bit.BlazorUI.AssetsIcon pack: if you want to use the Fabric Icons of the bit BlazorUI (using BitIconName class) you need to add the Bit.BlazorUI.Icons package:
dotnet add package Bit.BlazorUI.IconsInstall-Package Bit.BlazorUI.Icons2. Namespace
Add the following line to the
@using Bit.BlazorUI3. Styles and Scripts
Open
<link href="_content/Bit.BlazorUI/styles/bit.blazorui.css" rel="stylesheet" />Then add the JS file script tag:
<script src="_content/Bit.BlazorUI/scripts/bit.blazorui.js"></script>Extra components: if you are using the
<link href="_content/Bit.BlazorUI.Extras/styles/bit.blazorui.extras.css" rel="stylesheet" /><script src="_content/Bit.BlazorUI.Extras/scripts/bit.blazorui.extras.js"></script>Optional assets: if you are using the
<link href="_content/Bit.BlazorUI.Assets/styles/bit.blazorui.assets.css" rel="stylesheet" />Icon pack: if you are using the
<link href="_content/Bit.BlazorUI.Icons/styles/bit.blazorui.icons.css" rel="stylesheet" />4. Cache busting
You need to make sure you've implemented a proper cache busting strategy
for all resources mentioned above. Otherwise users will encounter issues related
to cached versions of resources after you update the bit BlazorUI in your project.
On .NET 9 or later you can simply use the new
The
<script src="_content/Bit.BlazorUI/scripts/[email protected]"></script>Automatic resource fingerprinting
The
Bit.BlazorUI.Assets
package provides two
standalone components designed for automatic fingerprinting in the
Script: a drop-in replacement for the standard HTML
<Script Src="_content/Bit.BlazorUI/scripts/bit.blazorui.js"></Script>Example output:
<script src="_content/Bit.BlazorUI/scripts/bit.blazorui.js?v=sha256-Z5yBv0K89OBRVurhAVzatpp3aGXsNn00e3GzQiTq_Z4"></script>Link: a direct replacement for the standard HTML
<Link Href="_content/Bit.BlazorUI/styles/bit.blazorui.css" rel="stylesheet" />Example output:
<link href="_content/Bit.BlazorUI/styles/bit.blazorui.css?v=sha256-VI6BIGZLTtmyhn3V-4RH-Yyi0Ud3p0g5dHvByeaoZ9Y" rel="stylesheet" />Note: You can check out the usages of these two components in our demo website project here .
Feedback
You can give us your feedback through our GitHub repo by filing a new Issue or starting a new Discussion.