Skip to content

Latest commit

 

History

History
129 lines (111 loc) · 6.99 KB

README.md

File metadata and controls

129 lines (111 loc) · 6.99 KB

MudBlazor

Material Design components for Blazor

GitHub Workflow Status Codecov Quality Gate Status GitHub GitHub Repo stars GitHub last commit Contributors Discussions Discord Twitter NuGet version NuGet downloads

MudBlazor is an ambitious Material Design component framework for Blazor with an emphasis on ease of use and clear structure. It is perfect for .NET developers who want to rapidly build web applications without having to struggle with CSS and Javascript. MudBlazor, being written entirely in C#, empowers you to adapt, fix or extend the framework. There are plenty of examples in the documentation, which makes understanding and learning MudBlazor very easy.

Documentation & Demo

Why is MudBlazor so successful?

  • Clean and aesthetic graphic design based on Material Design.
  • Clear and easy to understand structure.
  • Good documentation with many examples and source snippets.
  • All components are written entirely in C#, no JavaScript allowed (except where absolutely necessary).
  • Users can make beautiful apps without needing CSS (but they can of course use CSS too).
  • No dependencies on other component libraries, 100% control over components and features.
  • Stability! We strive for a complete test coverage.
  • Releases often so developers can get their PRs and fixes in a timely fashion.

Prerequisites

MudBlazor .NET Support
1.x.x - 2.0.x .NET 3.1 Ended 03/2021
5.x.x .NET 5 Ended 01/2022
6.x.x .NET 6, .NET 7, .NET 8 Ended 01/2025
7.x.x .NET 7, .NET 8 ✔️
8.x.x .NET 8, .NET 9 ✔️

Warning

  1. Static rendering is not supported - Learn more.
  2. We cannot guarantee compatibility with browsers no longer maintained by their publishers. For the best experience, use an up-to-date browser - See Blazor supported platforms.

Stats

Alt

Contributing

👋 Thanks for wanting to contribute!
Contributions from the community are what makes MudBlazor successful.

If you are familiar with technologies like C#, Blazor, JavaScript, or CSS, and wish to give something back, please consider submitting a pull request! We try to merge all non-breaking bugfixes and will deliberate the value of new features for the community. Please note there is no guarantee your PR will be merged, so if you want to be sure before investing the work, feel free to contact the team first.

Check out the contribution guidelines to understand our goals and learn more about the internals of the project.

Getting Started

We have premade templates available at the MudBlazor.Templates repository.

Full installation instructions can be found on our website.

Quick Installation Guide

Install Package

dotnet add package MudBlazor

Add the following to _Imports.razor

@using MudBlazor

Add the following to the MainLayout.razor or App.razor

<MudThemeProvider/>
<MudPopoverProvider/>
<MudDialogProvider/>
<MudSnackbarProvider/>

Add the following to your HTML head section, it's either index.html or _Layout.cshtml/_Host.cshtml/App.razor depending on whether you're running WebAssembly or Server

<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet" />
<link href="_content/MudBlazor/MudBlazor.min.css" rel="stylesheet" />

Next, add the following to the default Blazor script at the end of the body

<script src="_content/MudBlazor/MudBlazor.min.js"></script>

Add the following to the relevant sections of Program.cs

using MudBlazor.Services;
builder.Services.AddMudServices();

Usage

<MudText Typo="Typo.h6">
    MudBlazor is @Text
</MudText>

<MudButton Variant="Variant.Filled" 
           Color="Color.Primary" 
           OnClick="ButtonOnClick">
    @ButtonText
</MudButton>

@code {
    string Text { get; set; } = "????";
    string ButtonText { get; set; } = "Click Me";
    int ClickCount { get; set; }

    void ButtonOnClick()
    {
        ClickCount += 1;
        Text = $"Awesome x {ClickCount}";
        ButtonText = "Click Me Again";
    }
}