MudBlazor.Extensions 8.15.1

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package MudBlazor.Extensions --version 8.15.1
                    
NuGet\Install-Package MudBlazor.Extensions -Version 8.15.1
                    
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="MudBlazor.Extensions" Version="8.15.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MudBlazor.Extensions" Version="8.15.1" />
                    
Directory.Packages.props
<PackageReference Include="MudBlazor.Extensions" />
                    
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 MudBlazor.Extensions --version 8.15.1
                    
#r "nuget: MudBlazor.Extensions, 8.15.1"
                    
#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 MudBlazor.Extensions@8.15.1
                    
#: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=MudBlazor.Extensions&version=8.15.1
                    
Install as a Cake Addin
#tool nuget:?package=MudBlazor.Extensions&version=8.15.1
                    
Install as a Cake Tool

GitHub Repo stars GitHub GitHub last commit Nuget version Nuget downloads Website Publish Nuget Preview Package and deploy Test App Publish Nuget Release Package Deploy TryMudEx

MudBlazor.Extensions

The MudBlazor.Extensions is a convenient package that extends the capabilities of the MudBlazor component library. This guide will demonstrate the setup process for your project, along with detailed explanations of the components, extensions, and functionalities provided. It's important to note that this package requires a MudBlazor project and the referenced MudBlazor package. For further information and assistance, please visit the official MudBlazor documentation at MudBlazor and MudBlazor/Templates.

Demos

Azure Cloudflare

Try Online

TryMudEx

Table of Contents

Installation

The installation process is straightforward. All you need to do is add the MudBlazor.Extensions NuGet package to your Blazor project. You can do this using the following code:

<PackageReference Include="MudBlazor.Extensions" Version="*" />

Setting Up MudBlazor.Extensions

Setting up MudBlazor.Extensions involves three steps:

  1. Update the _Imports.razor with the following lines:
@using MudBlazor.Extensions
@using MudBlazor.Extensions.Components
@using MudBlazor.Extensions.Components.ObjectEdit
  1. Register MudBlazor.Extensions in your Startup.cs in the ConfigureServices method.
// use this to add MudServices and the MudBlazor.Extensions
builder.Services.AddMudServicesWithExtensions();

// or this to add only the MudBlazor.Extensions but please ensure that this is added after mud servicdes are added. That means after `AddMudServices`
builder.Services.AddMudExtensions();
  1. (Optional) Define default dialogOptions.
builder.Services.AddMudServicesWithExtensions(c =>
{
    c.WithDefaultDialogOptions(ex =>
    {
        ex.Position = DialogPosition.BottomRight;
    });
});

if your are running on Blazor Server side, you should also use the MudBlazorExtensionMiddleware you can do this in your startup or program.cs by adding the following line on your WebApplication:

    app.Use(MudExWebApp.MudExMiddleware);

(Optional) if you have problems with automatic loaded styles you can also load the styles manually by adding the following line to your index.html or _Host.cshtml

<link id="mudex-styles" href="_content/MudBlazor.Extensions/mudBlazorExtensions.min.css" rel="stylesheet">

If you have loaded styles manually you should disable the automatic loading of the styles in the AddMudExtensions or AddMudServicesWithExtensions method. You can do this by adding the following line to your Startup.cs in the ConfigureServices method.

builder.Services.AddMudServicesWithExtensions(c => c.WithoutAutomaticCssLoading());

Showcase Videos

<details> <summary>Expand videos</summary>

Showcase

https://github.com/fgilde/MudBlazor.Extensions/assets/11070717/39e06d88-a947-43cd-9151-a7cf96bcd849

https://github.com/fgilde/MudBlazor.Extensions/assets/11070717/3c77b8bf-6198-4385-b452-f25cc2852e0a

https://github.com/fgilde/MudBlazor.Extensions/assets/11070717/ce9bdf86-aaf9-4f04-b861-bd57698bb7f5

https://github.com/fgilde/MudBlazor.Extensions/assets/11070717/6b054bdc-a413-437c-8dbb-ded4e242d2a7

https://github.com/fgilde/MudBlazor.Extensions/assets/11070717/57f39cec-c3e9-43aa-8bfe-260d9aa05f63

https://github.com/fgilde/MudBlazor.Extensions/assets/11070717/c6a0e47d-2ed6-4a4e-b2b8-f4963274c9f8

https://github.com/fgilde/MudBlazor.Extensions/assets/11070717/3fc658d7-7fa2-487e-98d2-91860e00374a

https://github.com/fgilde/MudBlazor.Extensions/assets/11070717/aa266253-f1ac-450d-bd7b-510d2b99e3c0

https://github.com/fgilde/MudBlazor.Extensions/assets/11070717/cf4ff772-953e-4462-90fc-b32249083fb8

https://github.com/fgilde/MudBlazor.Extensions/assets/11070717/79bccec3-9e04-4901-a7d2-a08c9cef031c

https://github.com/fgilde/MudBlazor.Extensions/assets/11070717/8963eaaa-0f96-4c76-8e3c-c945920b2c23

https://github.com/fgilde/MudBlazor.Extensions/assets/11070717/cd5bab33-75cd-442d-a156-f43cc3a1c78c

https://github.com/fgilde/MudBlazor.Extensions/assets/11070717/8545a70c-1ce2-4683-8f1e-40a69efe462b

https://github.com/fgilde/MudBlazor.Extensions/assets/11070717/5c736020-94ba-431a-94f7-8e437530978e

</details>

Components

This section introduces you to the various components provided by the MudBlazor.Extensions.

MudExObjectEdit

The MudExObjectEdit is a robust component that allows for object editing and automatically generates the corresponding UI. This component supports automatic validation for DataAnnotation Validations or fluent registered validations for your model.

To use MudExObjectEdit, you can simply use the MudExObjectEditForm and pass your model to it as shown below:

<MudExObjectEditForm OnValidSubmit="@OnSubmit" Value="@MyModel"></MudExObjectEditForm>

You can also utilize the MudExObjectEditDialog to edit your model in a dialog. The easiest way to do this is by using the extension method EditObject on the IDialogService.

dialogService.EditObject(User, "Dialog Title", dialogOptionsEx);

More

MudExStructuredDataEditor

The MudExStructuredDataEditor is a component that allows object editing and automatically generates the corresponding UI based on structured data like json, xml or yaml. This component supports all the same as MudExObjectEditForm.

To use MudExStructuredDataEditor, you can simply bind your data string shown as bellow:

    <MudExStructuredDataEditor @bind-Data="_dataString"></MudExStructuredDataEditor>

You can also utilize the MudExStructuredDataEditor to edit your data in a dialog. The easiest way to do this is by using the extension method EditStructuredDataString on the IDialogService.

dialogService.EditStructuredDataString(_dataType, _dataString, $"Auto Generated Editor for {_dataType}", ((_,_) => Task.FromResult("")));

You can find a running Sample here

MudExFileDisplay

The MudExFileDisplay component is designed to display file contents, such as a preview before uploading or for referenced files. This component can automatically handle URLs or streams and deliver the best possible display. Additionally, you can implement IMudExFileDisplay in your own component to register a custom file display. This is excacly what MudExFileDisplayZip does, which is used by MudExFileDisplay to display zip files or what MudExFileDisplayMarkdown does to display markdown files.

Example of using MudExFileDisplay:

 <MudExFileDisplay FileName="NameOfYourFile.pdf" ContentType="application/pdf" Url="@Url"></MudExFileDisplay>

SAMPLE

MudExFileDisplayZip

This component can be automatically utilized by MudExFileDisplay, but can also be used manually if necessary. Note: If you're using the ContentStream it should not be closed or disposed.

 <MudExFileDisplayZip AllowDownload="@AllowDownload" RootFolderName="@FileName" ContentStream="@ContentStream" Url="@Url"></MudExFileDisplayZip>

SAMPLE

MudExFileDisplayDialog

A small dialog for the MudExFileDisplay Component. It can be used with static helpers as shown below:

 await MudExFileDisplayDialog.Show(_dialogService, dataUrl, request.FileName, request.ContentType, ex => ex.JsRuntime = _jsRuntime);

It can be used directly with an IBrowserFile:

 IBrowserFile file = File;
 await MudExFileDisplayDialog.Show(_dialogService, file, ex => ex.JsRuntime = _jsRuntime);

Or it can be used manually with the MudBlazor dialogService:

var parameters = new DialogParameters
{
    {nameof(Icon), BrowserFileExtensions.IconForFile(contentType)},
    {nameof(Url), url},
    {nameof(ContentType), contentType}
};
await dialogService.ShowEx<MudExFileDisplayDialog>(title, parameters, optionsEx);

SAMPLE

More

MudExUploadEdit

MudExUploadEdit is a versatile file upload component with a wide range of features such as MIME and extension whitelisting/blacklisting, folder upload, drag and drop, copy and paste, renaming, and integration with Dropbox, Google Drive, and OneDrive.

SAMPLE

More

Extensions

Resizable or Draggable Dialogs

You can make your dialogs resizable or draggable using the following code snippet:

var options = new DialogOptionsEx { Resizeable = true, DragMode = MudDialogDragMode.Simple, CloseButton = true, FullWidth = true };
var dialog = await _dialogService.ShowEx<YourMudDialog>("Your Dialog Title", parameters, options);

Adding a Maximize Button

You can add a maximize button to your dialogs with the following code:

var options = new DialogOptionsEx { MaximizeButton = true, CloseButton = true };
var dialog = await _dialogService.ShowEx<YourMudDialog>("Your Dialog Title", parameters, options);

Adding Custom Buttons

To add custom buttons to your dialog, first define the callback methods as JSInvokable in your component code:

[JSInvokable]
public void AlarmClick()
{
   // OnAlarmButton Click
}

[JSInvokable]
public void ColorLensClick()
{
   // OnColorLensButton Click
}

Next, define your custom buttons:

var buttons = new[]
{
    new MudDialogButton( DotNetObjectReference.Create(this as object), nameof(AlarmClick)) {Icon = Icons.Material.Filled.Alarm},
    new MudDialogButton( DotNetObjectReference.Create(this as object), nameof(ColorLensClick)) {Icon = Icons.Material.Filled.ColorLens},
};

Finally, add your custom buttons to the dialog:

var options = new DialogOptionsEx { MaximizeButton = true, CloseButton = true, Buttons = buttons };
var dialog = await _dialogService.ShowEx<YourMudDialog>("Your Dialog Title", parameters, options);

Your dialog can now look like this:

SAMPLE

Using Animation to Show Dialog

You can use animation to display your dialog. This is done by setting the Animation property of DialogOptionsEx.

var options = new DialogOptionsEx { 
    MaximizeButton = true, 
    CloseButton = true, 
    Buttons = buttons, 
    Position = DialogPosition.CenterRight, 
    Animation = AnimationType.SlideIn, 
    AnimationDuration = TimeSpan.FromMilliseconds(500),
    FullHeight = true
};
var dialog = await _dialogService.ShowEx<YourMudDialog>("Your Dialog Title", parameters, options);

SAMPLE

When you animate a dialog with dialogServiceEx, it's recommended to add the class mud-ex-dialog-initial to your dialog to ensure no visibility before animation.

<MudDialog Class="mud-ex-dialog-initial">

NOTE: All animations can be used on other components as well. Currently, the following animations are supported: SlideIn,FadeIn,Scale,Slide,Fade,Zoom,Roll,JackInTheBox,Hinge,Rotate,Bounce,Back,Jello,Wobble,Tada,Swing,HeadShake,Shake,RubberBand,Pulse,Flip,FlipX,FlipY.

Using Extension Method with an Action<YourDialog>

Instead of using DialogParameters, you can call the extension method with an Action<YourDialog>

await dialogService.ShowEx<SampleDialog>("Simple Dialog", dialog => { dialog.ContentMessage = "Hello"; },options);

More

Conclusion

This README file provides an overview of the MudBlazor.Extensions library, which is designed to simplify and enhance the development process in Blazor using MudBlazor. The library contains a variety of components, extensions, and features that aim to reduce the time and effort required to build intricate UIs. For additional information or help, visit the official MudBlazor website or MudBlazor GitHub repository.

We hope you find this library helpful and encourage you to provide any feedback or contribute to its development.

License

MudBlazor.Extensions is released under the MIT License. See the bundled LICENSE file for details.

Change Log

Latest Changes:

  • 8.14.1 > New Component MudExRangeSlider
  • 8.14.1 > New Component MudExEditConfiguration
  • 8.14.0 > Update to MudBlazor 8.14.0
  • 8.14.0 > Add support for .net 10
  • 8.14.0 > Add simple demo for MudExPicker combined with MudExTreeView here
  • 8.13.0 > Move MudExComponentPropertyGrid to MudEx, to have the easy possibility to add and component grid
  • 8.13.0 > Drag and Drop in MudExGrid here
  • 8.13.0 > New GroupMode DockPanel for MudExObjectEdit sample here
  • 8.13.0 > New Component MudExDockLayout sample here
  • 8.13.0 > New Component MudExGravatarCard sample here
  • 8.11.0 > MudExObject edit now supports grouping by tabs and accordions. See sample here
  • 8.11.0 > Small bug fixes
  • 8.9.0 > Support touch events for dialog dragging
  • 8.9.0 > Fixes bug with icon picker if no value is specified
  • 8.9.0 > Fixes bug with custom size in non modal dialogs
  • 8.9.0 > Update MudBlazor to 8.9.0 and other Packages to latest version
  • 8.8.0 > Update MudBlazor to 8.8.0 and other Packages to latest version
  • 8.8.0 > Fix Bug in MudExOneDriveFilePicker where the file couldnt be loaded when AutoLoadDataBytes is true
  • 8.7.0 > Update MudBlazor to 8.7.0
  • 8.7.0 > Fix bug in SnapDrag Mode for dialog

Full change log can be found here

If you like this package, please star it on GitHub and share it with your friends If not, you can give a star anyway and let me know what I can improve to make it better for you.

GitHub NuGet

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (8)

Showing the top 5 NuGet packages that depend on MudBlazor.Extensions:

Package Downloads
MudExRichTextEditor

MudExRichTextEditor is a custom reusable control that allows us to easily consume Quill combining in a MudBlazor project.

Corsinvest.AppHero.Core.MudBlazorUI

Package Description

VaultForce.SharedClient

shared resources

MudExObjectEdit.CodeGatorAdapter

This is a small package to combine CG.Blazor.Forms with the MudExObjectEdit from MudBlazor.Extensions

MudraX.Blazor.Core

MudraX Blazor Core Library

GitHub repositories (3)

Showing the top 3 popular GitHub repositories that depend on MudBlazor.Extensions:

Repository Stars
DragoQCC/CrucibleC2
A C# Command & Control framework
CervantesSec/cervantes
Cervantes is an open-source, collaborative platform designed specifically for pentesters and red teams. It serves as a comprehensive management tool, streamlining the organization of projects, clients, vulnerabilities, and reports in a single, centralized location.
fgilde/MudExRichTextEditor
Quill based RichEditor component for MudBlazor
Version Downloads Last Updated
9.0.0-prev-260113138-mudbla... 79 1/13/2026
8.15.1 4,808 1/13/2026
8.15.1-prev-2601041518-main 98 1/4/2026
8.15.1-prev-2601041448-main 95 1/4/2026
8.15.1-prev-2512121815-main 341 12/12/2025
8.15.1-prev-2512010752-main 602 12/1/2025
8.15.1-prev-2511302155-main 409 11/30/2025
8.15.1-prev-2511302141-main 409 11/30/2025
8.15.1-prev-2511302121-try-... 345 11/30/2025
8.15.1-prev-2511302116-try-... 352 11/30/2025
8.15.1-prev-2511302051-try-... 343 11/30/2025
8.15.1-prev-2511301823-try-... 340 11/30/2025
8.15.1-prev-2511301446-main 341 11/30/2025
8.15.1-prev-2511301443-main 335 11/30/2025
8.15.0 6,199 11/30/2025
8.15.0-prev-251130148-main 337 11/30/2025
8.14.3-prev-2511281137-copi... 134 11/28/2025
8.14.3-prev-2511281031-copi... 138 11/28/2025
8.14.3-prev-2511261642-main 179 11/26/2025
8.14.3-prev-2511241848-main 213 11/24/2025
Loading failed