Build .NET Web Apps Faster with Blazor & MudBlazor

Blazor and MudBlazor make it easier than ever to build modern, interactive web applications entirely in C#.

In this blog, I’ll teach you how to set up a .NET Blazor project with MudBlazor, scaffold a server-paged data grid, and wire it up to a minimal API—so you can start building fully functional, Material Design-powered apps without leaving C#.

What is Blazor?

Blazor is the ASP.NET Core UI framework that lets you build interactive web apps almost entirely in C# and Razor. You write components once, then choose a hosting model that suits the job: client-side WebAssembly, server-side SignalR, or hybrid desktop/mobile.

Key advantages include a reusable component model, full-stack C# (no context-switching to JavaScript unless you really want to), and tight integration with Visual Studio and the wider .NET tooling pipeline.

What is MudBlazor?

MudBlazor is an open-source Material Design component library for Blazor. It’s written in pure C#, ships via NuGet, and focuses on “zero-JS” developer ergonomics: you drop components, wire C# events, and let MudBlazor handle the styling, animations, and accessibility details.

Project Set-Up

  1. To get started quickly, you can use the dotnet templates provided by MudBlazor. They’re based on the Microsoft “Blazor Web App” template but have been modified to include MudBlazor components.

    dotnet new install MudBlazor.Templates
    dotnet new mudblazor --interactivity Auto --name MudBlazorDemo --all-interactive
  2. This will create a project with all MudBlazor services and components registered, so running the app will show the initial pages with the default theme used

Hands-On Example: Server-Paged Data Grid

  1. Add new class library project MudBlazorDemo.Shared which will contain shared models for server and client projects and add the following records:
public record OrderDto(int Id, string Customer, decimal Total);
public record PageResult<T>(int Total, IEnumerable<T> Data);

2. Reference the newly added project from both existing projects.

3. Create a simple orders repository contract and in-memory implementation of it:

public interface IOrderRepository
{
int Count();

IReadOnlyList<Order> GetPage(int page, int size);
}

public class OrderRepository : IOrderRepository
{
private readonly List<Order> _orders;

public OrderRepository()
{
var random = new Random();
var customerNames = new string[] { "Alice", "Bob", "Taylor", "Marcus", "Elena", "Fritz", "Maria" };

_orders = Enumerable.Range(1, 500).Select(index => new Order
{
Id = index,
Customer = customerNames[random.Next(customerNames.Length)],
Total = random.Next(50, 500),
CreatedUtc = DateTimeOffset.UtcNow.AddDays(-random.Next(90))
}).ToList();
}

public int Count() => _orders.Count;

public IReadOnlyList<Order> GetPage(int page, int size) =>
_orders.OrderBy(o => o.Id)
.Skip(page * size)
.Take(size)
.ToList();
}

4. Register the service into the DI container:

builder.Services.AddSingleton<IOrderRepository, OrderRepository>();

5. Create a minimal-API endpoint which returns paged orders from server:

app.MapGet("/api/orders", (
int page,
int pageSize,
IOrderRepository repo) =>
{
var total = repo.Count();
var orders = repo.GetPage(page, pageSize)
.Select(order => new OrderDto(order.Id, order.Customer, order.Total));

return Results.Ok(new PageResult<OrderDto>(total, orders));
});

6. Add navigation menu item for the orders page:

<MudNavLink Href="orders" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.List">Orders</MudNavLink>

7. Create a page Pages/Orders.razor in the MudBlazorDemo.Client project:

@page "/orders"
@inject HttpClient HttpClient
@using MudBlazor
@using MudBlazorDemo.Shared

<MudPaper Class="pa-4">
<MudTable ServerData="LoadPageAsync"
Hover="true"
Elevation="1">

<HeaderContent>
<MudTh>Id</MudTh>
<MudTh>Customer</MudTh>
<MudTh>Total ($)</MudTh>
</HeaderContent>

<RowTemplate>
<MudTd DataLabel="Id">@context.Id</MudTd>
<MudTd DataLabel="Customer">@context.Customer</MudTd>
<MudTd DataLabel="Total">
@context.Total.ToString("F2")
</MudTd>
</RowTemplate>

<PagerContent>
<MudTablePager />
</PagerContent>
</MudTable>

</MudPaper>

@code {
private async Task<TableData<OrderDto>> LoadPageAsync(TableState tableState, CancellationToken cancellationToken)
{
var pagedOrders = await HttpClient.GetFromJsonAsync<PageResult<OrderDto>>(
$"/api/orders?page={tableState.Page}&pageSize={tableState.PageSize}");

return new TableData<OrderDto>
{
TotalItems = pagedOrders!.Total,
Items = pagedOrders.Data
};
}
}

8. Register HttpClient into dependency injection container: because we use InteractiveAuto render mode and pre-rendering, we need to register it both in the server and client projects:
Server: builder.Services.AddHttpClient();
Client: builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });

9. Run the application. You should be able to see a table with the paged orders by navigating to the orders page:

Summary

MudBlazor gives Blazor the “batteries-included” UI layer many teams miss when they first leave the JavaScript world. In a green-field .NET 9 project you can:

  • Start fast – a single NuGet install, a couple of service registrations, and you’re scaffolding pages with fully-styled Material components.
  • Stay in C# – validation, event handling, and data shaping all live in one language and one set of tooling.
  • Scale later – today’s in-memory repository can become an EF Core context, an external REST API, or even a gRPC service without touching the table UI.
  • Ship lighter – MudBlazor’s no-JS philosophy keeps publish size and cognitive overhead low, while Blazor’s build pipeline handles trimming, compression, and AOT for you.

If you need a modern, opinionated component library that feels native to .NET, MudBlazor is a low-friction, high-leverage choice. Glue it to Blazor, wire up the minimal APIs or repositories that make sense for your domain, and focus your energy on delivering features—not chasing CSS classes or bundler configs.

Ready to take your Blazor projects further? Contact Trailhead to discuss how we can help make your software more robust, interactive, and accessible. Happy coding!

Picture of Stefan Mitic

Stefan Mitic

Stefan is an experienced .NET developer from Serbia with seven years in the software industry. Stefan earned his B.S. in Computer Science and at the Faculty of Electrical Engineering, University of Nis. Over the course of his career, he has contributed to various projects, including Geographic Information Systems (GIS), Enterprise Resource Planning (ERP) solutions, Warehouse Management Systems (WMS), and Product Information Management (PIM) systems. Driven by a passion for building high- performance software, he focuses on creating robust, efficient, and scalable solutions. His strengths lie in problem-solving and delivering reliable results. Beyond his professional pursuits, Stefan enjoys tennis, football, playing guitar, and playing chess.

Free Consultation

Sign up for a FREE consultation with one of Trailhead's experts.

"*" indicates required fields

This field is for validation purposes and should be left unchanged.

Related Blog Posts

We hope you’ve found this to be helpful and are walking away with some new, useful insights. If you want to learn more, here are a couple of related articles that others also usually find to be interesting:

Our Gear Is Packed and We're Excited to Explore With You

Ready to come with us? 

Together, we can map your company’s software journey and start down the right trails. If you’re set to take the first step, simply fill out our contact form. We’ll be in touch quickly – and you’ll have a partner who is ready to help your company take the next step on its software journey. 

We can’t wait to hear from you! 

Main Contact

This field is for validation purposes and should be left unchanged.

Together, we can map your company’s tech journey and start down the trails. If you’re set to take the first step, simply fill out the form below. We’ll be in touch – and you’ll have a partner who cares about you and your company. 

We can’t wait to hear from you! 

Montage Portal

Montage Furniture Services provides furniture protection plans and claims processing services to a wide selection of furniture retailers and consumers.

Project Background

Montage was looking to build a new web portal for both Retailers and Consumers, which would integrate with Dynamics CRM and other legacy systems. The portal needed to be multi tenant and support branding and configuration for different Retailers. Trailhead architected the new Montage Platform, including the Portal and all of it’s back end integrations, did the UI/UX and then delivered the new system, along with enhancements to DevOps and processes.

Logistics

We’ve logged countless miles exploring the tech world. In doing so, we gained the experience that enables us to deliver your unique software and systems architecture needs. Our team of seasoned tech vets can provide you with:

Custom App and Software Development

We collaborate with you throughout the entire process because your customized tech should fit your needs, not just those of other clients.

Cloud and Mobile Applications

The modern world demands versatile technology, and this is exactly what your mobile and cloud-based apps will give you.

User Experience and Interface (UX/UI) Design

We want your end users to have optimal experiences with tech that is highly intuitive and responsive.

DevOps

This combination of Agile software development and IT operations provides you with high-quality software at reduced cost, time, and risk.

Trailhead stepped into a challenging project – building our new web architecture and redeveloping our portals at the same time the business was migrating from a legacy system to our new CRM solution. They were able to not only significantly improve our web development architecture but our development and deployment processes as well as the functionality and performance of our portals. The feedback from customers has been overwhelmingly positive. Trailhead has proven themselves to be a valuable partner.

– BOB DOERKSEN, Vice President of Technology Services
at Montage Furniture Services

Technologies Used

When you hit the trails, it is essential to bring appropriate gear. The same holds true for your digital technology needs. That’s why Trailhead builds custom solutions on trusted platforms like .NET, Angular, React, and Xamarin.

Expertise

We partner with businesses who need intuitive custom software, responsive mobile applications, and advanced cloud technologies. And our extensive experience in the tech field allows us to help you map out the right path for all your digital technology needs.

  • Project Management
  • Architecture
  • Web App Development
  • Cloud Development
  • DevOps
  • Process Improvements
  • Legacy System Integration
  • UI Design
  • Manual QA
  • Back end/API/Database development

We partner with businesses who need intuitive custom software, responsive mobile applications, and advanced cloud technologies. And our extensive experience in the tech field allows us to help you map out the right path for all your digital technology needs.

Our Gear Is Packed and We're Excited to Explore with You

Ready to come with us? 

Together, we can map your company’s tech journey and start down the trails. If you’re set to take the first step, simply fill out the contact form. We’ll be in touch – and you’ll have a partner who cares about you and your company. 

We can’t wait to hear from you! 

Thank you for reaching out.

You’ll be getting an email from our team shortly. If you need immediate assistance, please call (616) 371-1037.