The WebAwesome.AspNetCore.* family of packages provides a set of wrappers for the Web Components by Web Awesome for building Blazor applications.
The code is heavily inspired by Fluent UI Blazor. Docs and docs generation is from Blue Blazor.
It's recommended to use the official template Blazor Web App to create a new project using Visual Studio or CLI. Make sure, no sample content will be added.
dotnet add package WebAwesome.AspNetCore.Components
Add the following to your _Imports.razor file:
@using WebAwesome.AspNetCore.ComponentsNot yet required, but might be changed in the future.
Web Awesome Blazor comes with its own theme "blue", which is based on the styles of Blue Web. You can embed it like this:
<link
rel="stylesheet"
href="_content/WebAwesome.AspNetCore.Components/themes/blue.css"
/>In .NET 9 or later you can do it like this:
<link rel="stylesheet" href="@Assets["_content/WebAwesome.AspNetCore.Components/themes/blue.css"]">The library also contains the whole "dist-cdn" directory from the NPM package under "wwwroot/webawesome". So you can embed a theme like this:
<link
rel="stylesheet"
href="_content/WebAwesome.AspNetCore.Components/webawesome/styles/themes/default.css"
/>In .NET 9 or later you can do it like this:
<link rel="stylesheet" href="@Assets["_content/WebAwesome.AspNetCore.Components/webawesome/styles/themes/default.css"]">I implemented a solution, which automatically sets or unsets .wa-dark to the document element (<html>) based media query (prefers-color-scheme: dark). To enable it, just set class .wa-system to the <html> element.