ContextMenuMHD 1.4.6

dotnet add package ContextMenuMHD --version 1.4.6
                    
NuGet\Install-Package ContextMenuMHD -Version 1.4.6
                    
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="ContextMenuMHD" Version="1.4.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ContextMenuMHD" Version="1.4.6" />
                    
Directory.Packages.props
<PackageReference Include="ContextMenuMHD" />
                    
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 ContextMenuMHD --version 1.4.6
                    
#r "nuget: ContextMenuMHD, 1.4.6"
                    
#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 ContextMenuMHD@1.4.6
                    
#: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=ContextMenuMHD&version=1.4.6
                    
Install as a Cake Addin
#tool nuget:?package=ContextMenuMHD&version=1.4.6
                    
Install as a Cake Tool

๐Ÿ“ฆ ContextMenuMHD

ContextMenuMHD is a Blazor Web App component that enables custom right-click context menus with full flexibility and styling.

Developed specifically for .NET 9, this package provides a seamless way to add interactive context menus to your components.


๐Ÿš€ Features

  • Fully compatible with .NET 9
  • Works with both WebAssembly and Server Blazor
  • Simple setup and usage
  • Customizable menu items and click actions

๐Ÿ“ฆ Installation

Install the package via NuGet:

dotnet add package ContextMenuMHD

โš™๏ธ Setup

Add the JavaScript and CSS references to your wwwroot/index.html (for Blazor WASM) or Pages/_Host.cshtml / App.razor (for Blazor Server):

<script src="_content/ContextMenuMHD/scripts/contextMenuMHD.js"></script>
<link href="_content/ContextMenuMHD/css/contextMenuMHD.css" rel="stylesheet" />

๐Ÿงช Usage Example

๐Ÿ“Œ In your Razor component:

<ContextMenu ElementId="menu2" Options="@Options2">
    <div style="padding:10px; border:1px solid gray;">
        Click right here
    </div>
</ContextMenu>

๐Ÿ“Œ In your C# code:

List<MenuItem>? Options2;

protected override void OnInitialized()
{
    Options2 = new List<MenuItem>
    {
        new MenuItem { Label = "Opation 1", OnClick = () => logs("Hello 1"), IsEnabled = false },
        new MenuItem { Label = "Opation 2", OnClick = () => logs(1) }
    };
}

๐Ÿ“„ Requirements

  • .NET 9.0
  • Blazor Web App project

๐Ÿ†“ License

This package is free and open source, licensed under the MIT License.


๐Ÿค Contribution & Support

Feel free to open an issue or contribute via pull requests on GitHub. Feedback is always welcome!


๐Ÿ“ซ Author

Created with โค๏ธ by Mohamad Ataya

Product Compatible and additional computed target framework versions.
.NET 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

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.4.6 100 5/10/2026
1.4.5 260 11/16/2025
1.4.4 287 11/13/2025
1.4.3 285 11/12/2025
1.4.2 287 11/11/2025
1.4.1 207 7/8/2025
1.4.0 192 7/2/2025
1.3.0 189 6/23/2025
1.2.0 152 6/22/2025
1.1.0 186 5/26/2025
1.0.0 182 5/26/2025