Bakverk.Blazor 1.0.11

dotnet add package Bakverk.Blazor --version 1.0.11
                    
NuGet\Install-Package Bakverk.Blazor -Version 1.0.11
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Bakverk.Blazor" Version="1.0.11" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Bakverk.Blazor" Version="1.0.11" />
                    
Directory.Packages.props
<PackageReference Include="Bakverk.Blazor" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Bakverk.Blazor --version 1.0.11
                    
#r "nuget: Bakverk.Blazor, 1.0.11"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Bakverk.Blazor@1.0.11
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Bakverk.Blazor&version=1.0.11
                    
Install as a Cake Addin
#tool nuget:?package=Bakverk.Blazor&version=1.0.11
                    
Install as a Cake Tool

<img src="src/Bakverk.Blazor/wwwroot/icon.svg" width="96" alt="Bakverk.Blazor logo: a cinnamon bun" align="right" />

Bakverk.Blazor

My common Blazor component library, built on MudBlazor.

Install

dotnet add package Bakverk.Blazor

Setup

builder.Services.AddBakverkBlazor(); // includes AddMudServices() and BvThemeService

In _Imports.razor:

@using MudBlazor
@using Bakverk.Blazor

In index.html / App.razor, one stylesheet and one script, both in <head>:

<link rel="stylesheet" href="_content/Bakverk.Blazor/bakverk.blazor.css" />
<script src="_content/Bakverk.Blazor/bakverk.blazor.js" data-fontawesome-kit="your-kit-id"></script>
  • bakverk.blazor.css imports Roboto, MudBlazor's CSS and css/accessibility.css (focus rings, .skip-link, .visually-hidden).
  • bakverk.blazor.js loads MudBlazor's JS, plus Font Awesome if data-fontawesome-kit is set (falls back to the free CDN build if the kit is blocked, e.g. on localhost). Add data-no-mudblazor if the app already includes MudBlazor.min.js.
  • Focus ring styling can be overridden with --bv-focus-ring-width, --bv-focus-ring-outer and --bv-focus-ring-inner.
  • A focusable role="listbox", grid, tree or treegrid (or anything with aria-activedescendant) gets no ring around itself; it should mark its active item instead.

In the layout, BvThemeProvider in place of MudThemeProvider, plus the usual MudBlazor providers:

<BvThemeProvider />
<MudPopoverProvider />
<MudDialogProvider />
<MudSnackbarProvider />

Demo

src/Bakverk.Blazor.Demo is a Blazor WebAssembly app that shows every component and style, with a dark mode toggle. It remembers the chosen theme and dark mode in localStorage (see ThemePreferences.cs).

dotnet run --project src/Bakverk.Blazor.Demo

Tests

  • src/Bakverk.Blazor.Tests: unit tests.
  • src/Bakverk.Blazor.UiTests: Playwright tests that start the demo app and drive every component in headless Chromium.
dotnet build src/Bakverk.Blazor.slnx
pwsh src/Bakverk.Blazor.UiTests/bin/Debug/net11.0/playwright.ps1 install chromium
dotnet test src/Bakverk.Blazor.slnx

Conventions

  • All components use the Bv prefix: BvCard, BvConfirmDialog, …
  • Components build on MudBlazor; they don't replace it. Use Mud* directly when no Bv* wrapper exists.

Components

BvMonacoEditor

Monaco code editor (0.50.0, bundled). Nothing is downloaded until the first editor renders, and no script tags are needed.

<BvMonacoEditor @ref="_editor" Value="@_yaml" Language="yaml" DarkMode="@_isDarkMode" />

@code {
    private BvMonacoEditor _editor = default!;
    private async Task Save() => _yaml = await _editor.GetValueAsync();
}

Or two-way binding (one interop call per edit): <BvMonacoEditor @bind-Value="_text" Language="markdown" WordWrap />

Parameters: Value/ValueChanged, Language, ReadOnly, WordWrap, LineNumbers, Minimap, DarkMode, Height (default 600px), Class, Style.

BvMarkdownEditor

Simple, block-based markdown editor. Markdown shortcuts (# , - , 1. , [] , > , ```, ---) convert as you type, <kbd>Tab</kbd> indents list items, and anything the blocks can't represent (tables, …) is kept as raw markdown.

<BvMarkdownEditor @bind-Value="_markdown" />

<BvMarkdownEditor @ref="_editor" Value="@_markdown" OnChange="@(() => _dirty = true)" />
@code {
    private BvMarkdownEditor _editor = default!;
    private void Save() => _markdown = _editor.GetMarkdown();
}

Parameters: Value/ValueChanged, OnChange (raised on every edit without serializing).

BvMarkdownSplitEditor

Advanced markdown editor: markdown source in BvMonacoEditor with a live BvMarkdown preview beside it, stacked on narrow screens.

<BvMarkdownSplitEditor @bind-Value="_markdown" DarkMode="@_isDarkMode" Height="70vh" />

Parameters: Value/ValueChanged, ShowPreview (default true), WordWrap (default true), LineNumbers, ReadOnly, DarkMode, Height (default 600px), Class, Style.

BvMarkdown

Renders markdown as styled HTML (Markdig with GitHub-style extensions: tables, task lists, …). Styles are scoped to the component, so no stylesheet is needed. Raw HTML is passed through, so only render trusted content.

<BvMarkdown Value="@_markdown" />

Themes

BvThemes is a catalog of named MudThemes, each with a light and a dark palette: Fjord, Taiga, Frost, Bilberry, Cloudberry, Heather, Skerry, Polar Night, Granite, Rosehip, Tarn, Midnight Sun, Blue Hour, Harbor and Lavender (BvThemes.InitialName). BvThemes.Get(name) falls back to Lavender for unknown names.

BvThemes.OtherNames holds themes with more character that aren't in BvThemes.Names, so a menu built from Names won't list them. Pick one explicitly with Themes.SetTheme(BvThemes.BadlandsName):

  • Badlands: cel-shaded comic look in the Borderlands Wiki's colors. Black pages with a maroon frame and gold links in dark mode, the same maroon, burnt orange and purple on light pages in light mode, black ink outlines with hard offset shadows on raised surfaces (cards, menus, popovers, dialogs), and uppercase Impact headings and buttons.
  • Meadow: cozy farming-village look. Parchment, leaf green, berry pink and lavender by day, dusky indigo by night, storybook serif headings, soft rounded corners and a gentle ledge under raised surfaces.

BvThemeService (registered by AddBakverkBlazor()) holds the selected ThemeName and IsDark, and raises ThemeNameChanged and ThemeChanged. Persisting the choice is up to the app.

BvThemeProvider renders a MudThemeProvider that follows BvThemeService, and toggles dark mode when <kbd>F8</kbd> is pressed anywhere on the page, including inside an editor. Read Themes.IsDark (and subscribe to ThemeChanged) instead of keeping a local dark mode flag.

@inject BvThemeService Themes

<BvThemeProvider />

<MudIconButton Icon="@Icons.Material.Filled.DarkMode" OnClick="@Themes.ToggleAsync" aria-keyshortcuts="F8" />

@foreach (var name in BvThemes.Names)
{
    <MudMenuItem OnClick="@(() => Themes.SetTheme(name))">@name</MudMenuItem>
}

AddBakverkBlazor(c => ...) passes the configuration on to AddMudServices.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.0.11 0 11/18/2026
1.0.10 0 11/18/2026
1.0.9 78 11/10/2026
1.0.8 146 11/10/2026
1.0.7 119 11/10/2026
1.0.6 86 11/10/2026
1.0.5 111 11/10/2026
1.0.4 131 11/10/2026
1.0.3 171 11/4/2026
1.0.2 100 11/3/2026
1.0.1 94 11/3/2026
1.0.0 91 11/3/2026