Getting started - Blazor WebApp (.NET 8) - Interactive render mode Server - Global location
Learn how to quickly set up BlazorExpress.Bulma
in your Blazor WebApp (Server) project using dotnet templates or manual installation, and how to register required services.
Prerequisites #
- .NET 8 SDK (Download) or later version
- Visual Studio 2022 or later / VS Code / JetBrains Rider
- Basic knowledge of Blazor WebAssembly
1. Using dotnet Templates #
- Install the template:
TODO: Update the instructions.
The template sets up Bulma CSS, the required services, and sample components.
2. Manual Installation #
- Add the NuGet package:
dotnet add package BlazorExpress.Bulma
- Add CSS references:
After the
base
tag in thehead
section of theComponents/App.razor
file, add the following references:<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@1.0.0/css/bulma.min.css"> <link rel="stylesheet" href="_content/BlazorExpress.Bulma/css/blazorexpress.bulma.css">
- Add JS references:
Insert the following references into the
body
section of theComponents/App.razor
file, immediately after the_framework/blazor.web.js
reference:<script src="_content/BlazorExpress.Bulma/js/blazorexpress.bulma.js"></script>
- Register services:
Add
@using BlazorExpress.Bulma
to_Imports.razor
:@using BlazorExpress.Bulma
3. Usage Example #
- Add a Bulma component to
Components/Pages/Home.razor
:<Button Color="ButtonColor.Primary">Hello BlazorExpress.Bulma!</Button>
4. Troubleshooting #
- Ensure all CSS and JS references are correct in
App.razor
. - Restart the development server after making changes to static files.
- Check the browser console for errors if components do not render as expected.