r/Blazor

Out now: The Microsoft Fluent UI Blazor library v5 RC3!
▲ 44 r/Blazor

Out now: The Microsoft Fluent UI Blazor library v5 RC3!

Lots of refinements, bug fixes and even 2 new components: Wizard and ColorPicker

For the next RCs and final release I'm creating something new that I think a lot of devs will like...a Charts package. Stay tuned!

Packages are available on NuGet now.

u/vnbaaij — 3 days ago
▲ 12 r/Blazor+1 crossposts

Blazor + Alpine

I’m planning a new project and would like some feedback on the stack choice.

My goal is to go as “full C#” as possible while keeping JavaScript to a minimum. I also want to avoid WebAssembly and avoid a heavy initial bundle.

The project is fairly simple:

A landing page (with some animations) An admin panel for task management Drag and drop functionality for tasks

What I’m considering right now:

Blazor SSR (Server-Side Rendering) Alpine.js for lightweight interactivity Tailwind CSS for styling Possibly HTMX or Blazor “Enhanced Navigation” (I’m not fully familiar with it yet)

My main concerns are:

Keeping the initial load fast Avoiding unnecessary complexity Still having smooth UI interactions (especially drag and drop in the admin panel)

Has anyone tried a similar setup? Would Blazor SSR + Alpine + HTMX make sense together, or is it better to stick to one interaction model?

Any advice or real-world experience would be appreciated.

reddit.com
u/ze-fernando — 4 days ago
▲ 0 r/Blazor

Read only if bored - TLDR - I hate f-ing spaces more than nulls.

I started my development path creating relational databases. Working with nulls was just part of the job, no complaints, I do not have an issue with them. Yes, I know that's a volatile topic, but I'm perfectly happy if you hate them; this isn't about nulls in databases.

I then became a general developer working with Microsoft technology. When I started it was relatively straightforward, VB desktop apps with a SQL Server backend or a distributed VB desktop apps with MTS or the odd intranet built with Classic ASP. I don't recall anyone moaning about nulls back then, although admittedly the internet wasn't what it is today and most developers were reading paper-based magazines or browsing MSDN CDs.

Around 2010, more and more articles began highlighting the problems nulls caused in applications. But here's the thing, in my career to date, I have spent considerably more time dealing with whitespace issues than I ever have with nulls.

I remember when SQL Server 2005 introduced, I started looking closer at user-defined functions. The very first thing I did with them was create a simple trim function I could use in table check constraints, so any varchar or nvarchar columns would have leading and trailing spaces removed, or be converted to null if the value was entirely whitespace on a nullable column. I still add trim to check constraints on every database I create. Some of you will think that's no big deal, but anyone who has spent serious time writing stored procedures and queries knows all too well how a field full of whitespace can completely destroy your report figures.

Right, enough history. On to my recent headache.

Some of you may know I am the author of the open source BlazorRamp project. What you may not know is that I also have a functional-style OSS validation library (Validated) with a companion project (Validated.Blazor) that integrates with Blazor's EditContext.

I'm currently working on the inputs for BlazorRamp and providing examples with validation, primarily using my own library but with at least one example using Data Annotations. Side note - I'm not a fan of data attributes, I tried them when they were first released but never warmed to them, so I've done my own thing ever since.

I am however a fan of regex, although you really do need to turn your brain upside down and inside out before working with them, especially once you start adding lookarounds.

In one of my examples I use a regex validator on a field, and on another I split validation so that one validator handles the allowed characters and a separate one handles length constraints. Anyway, during manual testing, which I do a lot of given my accessibility stuff, I noticed that a regex copied from another demo would correctly fail if a user typed "Paul " with a trailing space. The red error message would appear, but looking at the input control you can't see the issue unless you place the cursor in the field, and even then a single trailing space is easy to miss.

So what you may want is a regex that does what it needs to do, but doesn't fail on a trailing space, because your code can simply deal with that silently, right?.

Now some of you are thinking: "Noob, just add a normalise function in the property setter - it's even easier in C# 14 with the new field keyword, no backing field required."

set { field = NormaliseString(value); }

To those people I say: how's that going to work when you're using Blazor's oninput binding and you need to allow a space within the string value, just not after it?

This is one of those seemingly simple tasks that turns into an absolute cluster f*ck. No matter how you solve it, it's just more work, you either dirty your clean models or you end up re-validating them in your code to strip whitespace.

The solution I ended up with was adding an optional parameter to my BlazorValidationBuilder that, when set to true, mutates the string field on the model to remove leading and trailing whitespace but only during full model validation, i.e. when the form is submitted or you call validate explicitly.

For those who know my library, guessing that's approximately zero people, the BlazorValidationBuilder simply assigns validators to fields. There's no notion of mutation in the built-in validators; it's just a flag in the metadata that gets used when working with the EditContext. And just in case there is a dedicated user out there: yes, you could create a custom validator that trimmed the string, but when using the oninput option in BlazorRamp inputs or your own, it would be called on every keystroke, putting you right back to square one.

So, the point of this post: yet more days lost to whitespace. In this instance, updating, testing, and publishing a minor release of my OSS Blazor validation package just to trim a string. And I'm not done yet, I still need to update the documentation. People say nulls are bad. I say they've clearly have never spent a career at war with spaces.

Just in case you want to see what I was talking about go type stuff in the two inputs example on my BlazorRamp doc site: https://docs.blazorramp.uk/components/inputs/text-input/usage

The First name input is just a single regex that does job lot and fails with a trialing space, the Surname input will allow a single trailing space (could be more) which then gets stripped off on model validation. You can see this just be clicking the button and putting the cursor back in the input.

Break over. Back to work and then documentation, and then hopefully (please) a start on the next BlazorRamp input without whitespace issues.

Paul

reddit.com
u/code-dispenser — 4 days ago
▲ 10 r/Blazor

FluentUI or Radzen Component Library

Hi All.. I am currently evaluating Blazor and am looking at the different component libraries out there. I like both FluentUI and Radzen.

https://www.fluentui-blazor.net/

https://blazor.radzen.com/

I have heard that FluentUI is harder to style but from a contol point of view it looks like it has all the controls I would need. However Radzen looks equally good. At first I thought I could mix and match (and get the best of both worlds) because I noticed Radzen had a theme for "FluentUI" but unforunatly its not available on the free tier.

In the back of my head im thinking, If I went Radzen, I dont think I would use the material theme because then you are stuck with a particular style, and if I ever need to do anything outside the box I would be stuck (im a backend developer so UI and CSS is not my forte)

But I just wanted to see what everyone out here thinks and if you have any thoughts either way? Any pros and cons between them. It feels like once you pick a library, your kinda stuck with it, as the controls are littered througout the UI so im getting a bit analysis paralysis over here!

Would love to hear your thoughts, experiences, or any gotchas you ran into after picking one!

Thanks in advance!

reddit.com
u/masterofmisc — 6 days ago
▲ 5 r/Blazor

Top Blazor Articles Are All AI

My Blazor website BlazerHelpWebsite.com has been around since the beta days. Here is my latest article traffic, it seems to be all AI...

u/adefwebserver — 6 days ago
▲ 39 r/Blazor

I'm working on Flowy.Blazor v2

I'm working on Flowy.Blazor v2

v1 shipped as a hierarchical tree visualizer (drag & drop, auto-layout, zoom/pan, JSON import/export, custom node templates). v2 turns it into a proper visual editor — way bigger scope than I expected.

New in v2 (not in v1):

Canvas & navigation

  • Free canvas mode alongside tree mode (multi-root, manual positioning)
  • Programmatic viewport — FitViewAsyncSetViewportAsync (animated), GetViewportAsync
  • Fit to subset — fit the view to a specific set of item IDs
  • Pan boundaries (translateExtent) and min/max zoom clamps
  • Auto-pan when dragging near canvas edges (configurable speed + threshold)
  • Coordinate helpers — ScreenToFlowPositionAsync / FlowToScreenPositionAsync

Selection & editing

  • Marquee selection — shift-drag to box-select
  • Ctrl-click multi-select
  • Programmatic selection API — SelectItemAsyncSelectItemsAsyncClearSelectionAsyncRemoveSelectedAsync
  • Undo / Redo with configurable history depth
  • Bulk mutations — DeleteItemsAsync, read-only queries (AllItemsRootsGetChildren, etc.)
  • Promote / demote items in the tree, with OnTreeRestructured event
  • Manual layout — drop items at custom positions, OnItemRepositioned event
  • Snap to grid (configurable X/Y)

Edges

  • Edge markers — arrow heads on start/end with multiple variants
  • Edge styling — stroke width, dash patterns, animated dashes
  • Edge labels with animation support

Drag & drop

  • Configurable drag threshold
  • Drop position bands (left/right/under)
  • Drop validation — reject by depth, position, custom rules, with ValidationMessage
  • Cross-canvas dragging via a drag registry — move items between separate canvases
  • NoDrag class to opt subtrees out of dragging

Events

  • Pane events: OnPaneClickOnPaneContextMenuOnItemContextMenu
  • Hover events: OnItemMouseEnter / Leave / Move
  • Drag event log, drop events, tree restructure, error events

Other

  • Configurable keyboard bindings — every key (delete, undo, redo, pan/zoom activation, selection modifiers) is overridable; full disable supported
  • SVG export with options
  • Light/dark theming with token overrides
  • Background variants (slot + overlay) you can switch live
  • Minimap
  • Customizable toolbox palette

Small UX wins too: toolbar hides while dragging, smoother layout animations (JS-driven transforms), order map preserved across JSON round-trips.

u/VenniCidi — 6 days ago
▲ 0 r/Blazor+1 crossposts

I'm really excited about knowledge graphs...

This is mostly about AI, but since all my samples are in Blazor I felt it was appropriate to post it here.

I work on mostly business applications and use a lot of retrieval augmented generation however I recently discovered the power of knowledge graphs and recently wrote a blog post about it and would love to hear feedback.

More Powerful than AI RAG: Building Lightweight Knowledge Graphs

Basically if you have any data schema that has related entities you can easily build a knowledge graph saved as simple in memory json, and expose that to your AI through function tool calling.

Then allow your end users to ask questions and query that data in ways unachievable without a knowledge graph. This can also be used to update and make changes to your source data.

reddit.com
u/adefwebserver — 6 days ago
▲ 53 r/Blazor+1 crossposts

"Blazor can't compete with Next/React on perf." Lighthouse begs to differ.

Hi r/Blazor, Let me share MinCalc, a daily puzzle site I've been building on .NET 10 / Blazor WebAssembly.

What I'm most pleased with architecturally: it's a single Blazor Web App, but per-route render modes pull most of the weight off the WASM payload.

Breakdown of 37 routes:

- 26 Static SSR (Lighthouse perf 100, TBT 0–14ms): /about, archive/{ym}, /<game>/how-to-play, /<game>/archive, /<game>/hints/{date}, /blog/*

- 11 Interactive WASM (Lighthouse perf ~70, TBT ~2s — the real WASM tax, scoped to where gameplay actually needs it): /, /<game>, /<game>/play/<date>

The split rationale: SEO surfaces don't need client state, so they prerender to static HTML with zero JS islands. Game surfaces need keyboard input, tile animations, and persistence across navigation — those hydrate to WASM.

Game state survives navigation via [PersistentState] (a .NET 10 attribute that auto-serialises a property at prerender, rehydrates it after hydration — no manual PersistentComponentState plumbing).

https://preview.redd.it/faktldbk221h1.png?width=1337&format=png&auto=webp&s=2736760e87c939bc71817c031e9b1ae189022e71

A few things that bit me along the way:

- Scoped CSS doesn't traverse ChildContent — the scope attribute is on the wrapper, not the inner content

- Cross-mode navigation (Static SSR → Interactive) needs target="_top" until dotnet/aspnetcore#64541 lands

- IClock + WASM both have to render "today's puzzle" identically for prerender + hydration to agree

Five small puzzles, free, no account: mincalc.com

Happy to answer questions about the render-mode setup or anything else.

reddit.com
u/MinCalc — 9 days ago
▲ 23 r/Blazor

Claude code with blazor

I'm about to start a project with a friend and Ill use dotnet in the backend, it will be a simple project with a crud for users and other entities, the core usage will be a creation of a questionare that the customers will be able to generate and send to clients in order to perform some stuff.

The regular approach at least for me, is to choose react or angular. I'm a backend develop and will rely on AI to build the UI, what left me thinking if it would be a good time to use Blazor for this mvp as I have expertise with c# but I would like to know if has somebody actively using Claude code to code Blazor apps and what's is being the experience of so far.

reddit.com
u/saskx — 9 days ago
▲ 6 r/Blazor

Blazor server production on vps, no azure signalr service

Hi there! Who has tried blazor server in production without using azure signalr service? I want to know if it can handle 2000 concurrent users. Thanks =)

reddit.com
u/PatrickJohn87 — 8 days ago
▲ 0 r/Blazor

35+ years building customized enterprise software solutions

Hi everyone,

We’re United Information System, a software development and IT consultancy company established in 1990.

We develop customized business systems tailored to different industries, including healthcare, hospitality, accounting, HR, inventory management, and enterprise operations.

Our services include:

  • Custom Software Development
  • HR & Payroll Systems
  • Accounting Solutions
  • Inventory Management
  • Hospital & Hotel Systems
  • Web & Mobile Applications
  • IT Consultancy & Technical Support

Technologies we work with:
C#, ASP.NET Core, .NET, SQL Server, MAUI, Crystal Reports, and Visual Studio.

Our focus has always been on creating reliable, scalable, and practical solutions that match each business’s workflow and operational needs.

Always open to connecting with businesses, developers, and professionals interested in enterprise software and digital transformation.

📧 uis.ahmad.zrein@gmail.com
📞 +961 76 793 512

u/Severe-Earth5546 — 7 days ago
▲ 0 r/Blazor+1 crossposts

Did WASM solve a problem that now isn’t one?

The problem was JavaScript. .Net devs hate it. So did I. Blazor held the promise of eliminating it by letting you build your interactivity with C#.

Somewhere along the way, while WASM devs sweated though all the tradeoffs of slow initial load and lack of SEO, Claude came along and offered to build our JS for us, and it did it extremely well.

So when we a step back, isn’t it clear that Blazor is the best composition tool for the server, and JavaScript is the best and defacto standard language for client-side interactions?

All I’m saying is Claude has allowed me to lean into JS instead of dreading it. And the larger lesson, use the right tech for the job.

In our world, Blazor has become the new MVC. Tailwind is the new Bootstrap. DaisyUI sprinkled in lends a helping hand with modals and other widgets, but at OUR discretion.

And JavaScript is the new JavaScript. If you are stubbornly SSR like me, that won’t change. But libs like BlazorJSComponents help componentize it, and Claude is brilliant at building it where needed.

Embracing vanilla JS is like embracing JQuery in 2008. It’s a bit kinder and gentler now that we have Claude. Want partials/fragments? Grab HTMX, or build your fetcher/swapper in a couple hours.

reddit.com
u/VeganForAWhile — 11 days ago
▲ 15 r/Blazor+1 crossposts

I'm making Tanstack Query for blazor: RevalQuery

A little bit of context: I'm a Typescript React Developer that a few months back had the privilege to start learning .NET, and I love it. Aside from doing backend, I started doing a little bit of Blazor, and I liked it, though found curious there's no Asynchronous State Management library like the famous one from the JS ecosystem 'TanstackQuery' (available for the major frameworks/libraries Angular, Vue, React), at least not that I could found.

So, I took as an exercise, and as some way of contributing the community, to try and kind of "port" Tanstack's solution into the framework.

The repo https://github.com/kolostring/RevalQuery and the Nuget Package https://www.nuget.org/packages/RevalQuery.Blazor/

Here a quick example of how can be used both in the markup and the code.

@page "/search-bar-reval-query"
@using CachingDemo.Client.Services
@using RevalQuery.Core
@rendermode InteractiveWebAssembly
@inherits RevalQuery.Blazor.QueryComponentBase

&lt;PageTitle&gt;Search Bar Example&lt;/PageTitle&gt;

&lt;div class="search-box"&gt;
    &lt;div style="display: flex; gap: 8px;"&gt;
        &lt;input ="SearchTerm" :event="oninput" placeholder="Type to search..."/&gt;

        @if(Suggestions.IsFetching)
        {
            &lt;div&gt;
                Loading...
            &lt;/div&gt;
        }
    &lt;/div&gt;

    @if(Suggestions.Error is not null)
    {
        &lt;p style="color:red"&gt;Error: .Error.Message&lt;/p&gt;
    }
    else if (Suggestions.Data is not null)
    {
        &lt;ul&gt;
             (var item in Suggestions.Data)
            {
                &lt;li&gt;@item&lt;/li&gt;
            }
        &lt;/ul&gt;
    }
    else if (!Suggestions.IsFetching)
    {
        &lt;p&gt;&lt;em&gt;Nothing to show&lt;/em&gt;&lt;/p&gt;
    }
&lt;/div&gt;

@code {
    private string SearchTerm { get; set; } = string.Empty;

    IQueryState&lt;List&lt;string&gt;&gt; Suggestions =&gt; UseQuery(
        key: ("search", SearchTerm),
        handler: async static ctx =&gt;
        {
            var res = await SearchService.SearchAsync(ctx.Key.SearchTerm);
            return QueryResult.Success(res);
        },
        options =&gt; options
            .ConfigureFetch(fetch =&gt; fetch
                .StaleTime(TimeSpan.FromMinutes(5))
            )
    );
}

Main features include:

  • Key-based caching.
  • Shows stale data while revalidates it, following the pattern SWR and also has configurable data polling, retries (even tho I know HttpClient is configurable, but the library it's not limited only to network request since it works with any asynchronous handler)
  • Precalculated state booleans for your components conditional rendering (𝘐𝘴𝘓𝘰𝘢𝘥𝘪𝘯𝘨, 𝘐𝘴𝘍𝘦𝘵𝘤𝘩𝘪𝘯𝘨, 𝘐𝘴𝘌𝘹𝘤𝘦𝘱𝘵𝘪𝘰𝘯, 𝘐𝘴𝘙𝘦𝘴𝘰𝘭𝘷𝘦𝘥)
  • Side effects management with query canceling, invalidation and lifecycle callbacks that brings optimistic updates out of the box.
  • Memory Leak Protection by promoting stateless handlers via static callbacks.
  • Completely headless and compatible with any Components library like MudBlazor.

It's open-source MIT and I would like to get feedback since there's not much people that I know who could genuinely try it and/or contribute code wise.

EDIT: Broken code block due to using '@'.

EDIT2: The library isn't an AI generated solution. There's a lot of effort and learning behind it.

u/Double_Ease_6540 — 11 days ago
▲ 40 r/Blazor

What's happened to professionalism and due diligence in Blazor / .NET development - another rant from the old git.

I've been a developer for some time now. I am not a fancy front-end, back-end, or full-stack titled guy; I am just a developer that builds stuff, be it web, desktop or mobile, whatever needs building. Now, given almost 30 years, that's a lot of different tech, a lot of which devs will never have heard of.

Now, despite the saying "you are only as good as your last project", which has a lot of truth to it, there are some things that I have carried with me over the years, such as pride in my work, due diligence, and when a problem arises, the ability to work the problem, build environments if need be, and fix it.

When I started, at the start of each project it was the devs who built stuff; if you needed a network you built one, you installed and configured all the servers, everything, it was just what you did.

Later, when virtual machines became available such as VMware and Virtual PC (my first VM), you could then set up a VM if you needed a server on your PC instead of fighting with accounting to give you some cash for a new server, etc. In tandem with that, a lot of us also set up dual booting on our dev boxes. All of this was normal; I did not know any developer back then that did not dual boot or have at least one VM on their PC.

Why have I mentioned all of this? Because since my last rant, devs just seem to be getting worse. I am sorry, but devs now seem to be missing basic skills, or what I class as basic skills, such as being able to work through a problem outside of Visual Studio.

So since my last rant: https://www.reddit.com/r/Blazor/comments/1qxb6n8/whatever_happened_to_craftsmanship_in_blazor_oss/ there have been a few devs post their new commercial Blazor projects, some on this subreddit, some in the dotnet subreddit. You know how it goes: look at my super duper new Blazor thingamajig and here's the link to the live demo.

So you think, why not, let's take a look, only to find the site does not load, with the dev asking you if you have the latest browser installed. WTF, shall I reboot my PC as well?

You then mention that you have the latest versions of Chrome, Firefox, Edge on your Windows PC, and use the latest version of Safari on macOS, iOS, and the latest mobile Chrome browser on Android, and just for good measure you mention that you've also tried to access the site from both Europe and the US. Admittedly, I kind of switched off after the browser comment so was unwilling to help further.

Now some of you will flame me for not being more helpful/patient (did I not mention I tried a gazillion browsers and opened VPNs?), which is fair, but I am just sick of it; it's happening more and more.

As a developer reading this, you have just built something and you want to showcase it; do you not make sure it's all working OK before you do so?

And then, if there is a problem, rather than work the problem, do you just make comments about it probably being the user's browser?

On more than one occasion, the OP just continuously says it's working on their machine so it's probably your browser, and does not take note until about six hours have gone by and dozens of other Redditors across multiple threads and subreddits are all saying the same.

Bear in mind these are devs that are trying to sell you stuff; not open source, purely commercial.

If I were the OP and some dev (not some typical end user) just told me the site was not loading, before asking for more information I would be double-checking various things so I do not look like a complete idiot. And I would assume that if it's not loading, I have done something wrong, maybe a deployment issue or a server configuration issue, etc.

Does it work on my box if I clear my browser cache, in case there was a missing asset? Can I ping the server? tracert, netstat, DNS propagation checks, etc.

Can I access it from one of my VMs? I always have a couple on my dev box along with free VPNs for things like trying different geographical regions.

Now, in all the years I have been a developer, I have never not been able to figure out something like a site not loading problem. Yes, at some stage you may have to ask the user for more details, but not before you do your due diligence, especially if you are trying to sell me something.

And to top it all off, I mentioned that their commercial NuGet package had health issues, only to be told that they would check for missing metadata, as if I was just some moaning old fart (OK, I am), but they did not know that.

But I was not moaning about missing metadata; I was telling them their so-called professional product had NuGet/build issues, i.e. it was not deterministic and there was no Source Link. For starters, I am not going to install it without them. These are the things that tell you: this was built against this specific commit, it will build the same way every time, and if you do have a problem, you can step into the source code for that commit to find the issue; you know, the stuff that actually helps you solve problems.

If you are a commercial entity, a so-called professional developer trying to sell me something, and you do not even know how to ensure NuGet package health, give up your day job, because all you are doing is making the rest of us look bad with your incompetence. And if you can't figure out how to tick a couple of boxes and run a local NuGet feed to verify your package before release, then what on earth is your code going to be like?

Sorry folks I aint sugar coating for you.

Paul

reddit.com
u/code-dispenser — 12 days ago
▲ 6 r/Blazor+1 crossposts

[Promotion] Formaze v1.0 : an embeddable no-code form builder for Blazor

I've been building Blazor apps for a few years and kept running into the same problem: a client wants a new field here, a new section there, and suddenly you're modifying code, pushing a deployment, maybe even adding a column to the database. Or worse if you work on a multi-tenant Saas, maybe you want different configs for different tenant. Such a pain. For something that should take five minutes. So I built a form builder and packaged it as a NuGet to make it easier.

What it does:

Formaze lets you embed a fully functional form builder directly into your Blazor app. (V1 only for now but most basic inputs are there). End users (mostly admins or user with enough rights) can design their own forms through a WYSIWYG drag-and-drop UI, no code, no deployments. You just drop in the component and it handles the rest.

  • Drag & drop field reordering
  • Inline group/column configuration
  • Field options: masks, adornments, date pickers, validators
  • Single NuGet package, no external JS dependencies

Configuration Mode

Result

Tech note on MudBlazor:

The current UI layer is built on MudBlazor. If you're already using it, it's plug-and-play. If not, it does pull it in as a dependency, which is worth knowing upfront. Making the component layer swappable (so you could bring your own design system) is on the roadmap, but v1.0 is MudBlazor-first. MudBlazor allows you to change the theme of the whole application at the roots of your pages, so it is still highly customizable.

Why I built it:

Most form builder libraries I found were either JS-heavy, required a separate SaaS backend, or weren't embeddable at all. I wanted something that lives entirely inside the .NET ecosystem and ships as a self-contained package.

v1.0 is live on NuGet and there's a live demo on the site if you want to see it in action: Formaze

Happy to answer questions about the internals. The drag/drop state machine was an adventure.

reddit.com
u/Beginning_Ocelot_241 — 13 days ago
▲ 2 r/Blazor+1 crossposts

How I embedded a Blazor Server admin portal into an ASP.NET Core app via NuGet

Hey r/csharp,

I wanted to share an architectural approach I've been working on — embedding a full Blazor Server UI as a NuGet library into an existing ASP.NET Core application.

The idea: instead of building reporting UI from scratch in every project, package the entire Blazor portal as a library that drops into any ASP.NET Core app with minimal configuration.

**The core challenge** was making Blazor Server work as an embedded library rather than a standalone app. The key pieces:

**1. Serving static assets from the library**

Blazor's static files (JS, CSS) need to be served from the host app. This works via embedded resources and a custom middleware that intercepts requests to `/admin.css`, `/admin.js` etc:

```csharp

app.UseStaticFiles();

// Host app serves the library's embedded assets

```

**2. Routing — MapFallbackToPage**

The admin portal lives at `/reportadmin` without conflicting with the host app's routes:

```csharp

app.MapFallbackToPage("/reportadmin/{**path}", "/_Host");

app.MapFallbackToPage("/reportadmin", "/_Host");

```

**3. Data provider pattern**

Instead of hardcoding data access, consumers implement an interface:

```csharp

public interface IReportDataProvider

{

string EntityName { get; }

string DisplayName { get; }

IReadOnlyList<ReportColumnDefinition> AvailableColumns { get; }

IReadOnlyList<ReportFilterDefinition> AvailableFilters { get; }

Task<ReportTable> GetDataAsync(ReportBuilderRequest request, CancellationToken ct = default);

Task<int> GetCountAsync(ReportBuilderRequest request, CancellationToken ct = default);

}

```

**4. PDF generation in Blazor Server context**

Playwright's `CreateAsync()` throws a `NullReferenceException` when called directly from Blazor Server's synchronization context. The fix is wrapping in `Task.Run`:

```csharp

var pdfBytes = await Task.Run(async () =>

{

using var playwright = await Playwright.CreateAsync();

await using var browser = await playwright.Chromium.LaunchAsync(...);

// ...

}, ct);

```

**5. Offline license validation**

JWT tokens signed with RSA private key, validated against an embedded public key — no network calls, works air-gapped:

```csharp

var rsa = RSA.Create();

rsa.ImportFromPem(embeddedPublicKey);

var validationParams = new TokenValidationParameters

{

IssuerSigningKey = new RsaSecurityKey(rsa),

ValidateIssuerSigningKey = true,

// ...

};

```

The result is a library that adds a full reporting portal to any ASP.NET Core app — report builder, PDF/Excel export, scheduler, audit trail — without requiring a separate server or database beyond a local SQLite file.

Happy to go deeper on any of these pieces if anyone's interested.

**Live demo** if you want to see the end result: https://reporting.screamcode.com/reportadmin

u/screamcode-dev — 9 days ago
▲ 24 r/Blazor+1 crossposts

Introducing Pulse — in-app conformance testing for Blazor

I’m building Pulse, a small .NET test runner for conformance tests that run inside a real app host.

For Blazor WebAssembly, the goal is to test behavior that dotnet test can’t honestly prove: real IJSRuntime, imported JS modules, browser storage, host HttpClient, DI, and runtime services while the app is actually running in the browser.

The pattern:

  • put shared specs in *.TestSupport
  • run them against fakes with dotnet test
  • run the same behavior inside a real Blazor app with Pulse

example:

public abstract class TokenStorageSpec
{
    protected abstract ITokenStorage Storage { get; }

    protected async Task RoundTrips(CancellationToken ct)
    {
        await Storage.StoreAsync("auth", "abc", ct);
        if (await Storage.RetrieveAsync("auth", ct) != "abc")
            throw new InvalidOperationException("Token did not round-trip.");
    }
}

public sealed class BrowserStorageSuite(ITokenStorage storage) : TokenStorageSpec
{
    protected override ITokenStorage Storage =&gt; storage;

    [PulseCase(TimeoutMs = 5000)]
    public Task LocalStorage_round_trips(CancellationToken ct) =&gt; RoundTrips(ct);
}

So the fake-backed test proves the rule in dotnet test, and Pulse proves the same rule through the real browser/runtime boundary.

Pulse is intentionally small: one NuGet package, no Blazor-specific package, no Test Explorer integration, no UI framework, and it returns a structured TestRunReport.

It’s preview-stage. I’m still figuring out the right direction before calling it stable. The focus is conformance testing for app/runtime boundaries, not replacing unit tests or UI automation.

Specs/rules: https://github.com/Circuids/Pulse/blob/master/docs/conformance-specs-and-rules.md

GitHub: https://github.com/Circuids/Pulse

NuGet: Circuids.Pulse

Feedback welcome, especially from people building Blazor apps with JS interop, browser storage, host wiring, or runtime behavior that is awkward to verify in normal tests.

u/Aathif_Mahir — 13 days ago
▲ 2 r/Blazor

Blazor Ramp – Input Errors Summary

Yes, it's not the most inspired name, but "Validation Summary" was already taken by Blazor, so it is what it is, and it does exactly what it says on the tin.

Whilst working on the inputs for Blazor Ramp I thought I had best get this one out of the way early, given that each input needs to register itself with the summary component.

But why do that, you ask?

By doing so, each input can provide the summary component with its unique ID, and with that ID the summary can, as well as displaying error messages as the built-in Blazor one does, also provide a link directly to the erroneous input and, using a small amount of JavaScript, move focus to that input for the user.

OK, but why bother at all?

It's all about making things easier for the user. When they click the form's submit button, if there are any validation errors the summary component is displayed and focus moves directly to it.

Screen reader users are informed via the heading that there are problems with their entries, and on reviewing them in the summary they can activate a link to jump directly to the relevant field.

Screen reader users also have a wealth of keyboard shortcuts available to them, such as navigating by headings or landmarks. The summary section has been elevated to a landmark via role="region", so rather than scanning through headings they can navigate straight to it using the landmarks shortcut.

Given all the shortcuts available to screen reader users, I may need to create some sort of dialog component for sighted keyboard-only users, so they too can jump around busy pages without endless tabbing - but my to-do list is currently long enough, so that will have to wait.

I have said on numerous occasions that with inputs and forms, if you are going to use ARIA live regions to make announcements to the user, the submit button is the place to do it - not individual fields. That said, depending on how you structure things you can negate the need for a live region entirely, which is exactly what I have done here with the summary component.

When focus moves to the summary component a &lt;section&gt; element with both role="region" and an aria-labelledby attribute pointing to its heading - the screen reader announces to the user that they are now on a landmark region and reads the heading, such as "There is a problem with your entries", thus eliminating the need for a live region altogether.

Currently the summary only supports Blazor Ramp inputs, as getting the information needed to build links and set focus dynamically from the EditContext alone would require jumping through considerable hoops. By having the inputs register themselves with the summary, it has everything it needs and as the developer consuming the component, you do nothing other than add it alongside your inputs.

I may in the future add the ability to manually register inputs, or even do the necessary gymnastics to keep things fully dynamic, but I suspect most developers won't be mixing inputs from different libraries or rolling their own alongside Blazor Ramp's, so that may be something for the very distant future, if it is ever requested.

I will leave it there for now, for anyone interested in the details, everything is covered on my test and documentation sites. Any questions, fire away.

Docs/example: https://docs.blazorramp.uk/components/inputs/input-errors-summary/usage
Test site: https://blazorramp.uk/
Repo: https://github.com/BlazorRamp/Components

Regards

Paul

u/code-dispenser — 14 days ago