All Projects → Blazored → Menu

Blazored / Menu

Licence: mit
A JavaScript free menu library for Blazor and Razor Components applications.

Projects that are alternatives of or similar to Menu

Modal
A powerful and customizable modal implementation for Blazor applications.
Stars: ✭ 406 (+244.07%)
Mutual labels:  hacktoberfest, nuget, razor
Toast
A JavaScript free toast library for Blazor and Razor Component applications
Stars: ✭ 296 (+150.85%)
Mutual labels:  hacktoberfest, nuget, razor
Chartjs.blazor
Brings Chart.js charts to Blazor
Stars: ✭ 402 (+240.68%)
Mutual labels:  nuget, razor
Localstorage
A library to provide access to local storage in Blazor applications
Stars: ✭ 425 (+260.17%)
Mutual labels:  hacktoberfest, nuget
Wasmwinforms
C# Winforms for Webassembly
Stars: ✭ 444 (+276.27%)
Mutual labels:  nuget, webassembly
Blazorcontextmenu
A context menu component for Blazor !
Stars: ✭ 257 (+117.8%)
Mutual labels:  nuget, razor
Ant Design Blazor
🌈A set of enterprise-class UI components based on Ant Design and Blazor WebAssembly.
Stars: ✭ 3,890 (+3196.61%)
Mutual labels:  hacktoberfest, webassembly
Strongbox
Strongbox is an artifact repository manager.
Stars: ✭ 412 (+249.15%)
Mutual labels:  hacktoberfest, nuget
Uno
Build Mobile, Desktop and WebAssembly apps with C# and XAML. Today. Open source and professionally supported.
Stars: ✭ 6,029 (+5009.32%)
Mutual labels:  hacktoberfest, webassembly
Binaryen
Compiler infrastructure and toolchain library for WebAssembly
Stars: ✭ 5,294 (+4386.44%)
Mutual labels:  hacktoberfest, webassembly
Awesome Blazor
Resources for Blazor, a .NET web framework using C#/Razor and HTML that runs in the browser with WebAssembly.
Stars: ✭ 6,063 (+5038.14%)
Mutual labels:  webassembly, razor
ml-stack-nav
Customizable, responsive, accessible, easy-to-use multi-level stack navigation menu with slide effect.
Stars: ✭ 20 (-83.05%)
Mutual labels:  menus, menu
Photon
⚡ Rust/WebAssembly image processing library
Stars: ✭ 963 (+716.1%)
Mutual labels:  hacktoberfest, webassembly
32feet
Personal Area Networking for .NET
Stars: ✭ 395 (+234.75%)
Mutual labels:  hacktoberfest, nuget
vue-bottom-navigation
Vue bottom navigation
Stars: ✭ 56 (-52.54%)
Mutual labels:  menus, menu
ContextMenuSwift
A better version of iOS 13 Context Menu
Stars: ✭ 162 (+37.29%)
Mutual labels:  menus, menu
Mond
A scripting language for .NET Core
Stars: ✭ 237 (+100.85%)
Mutual labels:  hacktoberfest, nuget
Blazor.PersianDatePicker
A free JavaScript Jalali (Persian) and Gregorian (Miladi) dual datepicker library for Blazor applications
Stars: ✭ 40 (-66.1%)
Mutual labels:  nuget, razor
Quartznet
Quartz Enterprise Scheduler .NET
Stars: ✭ 4,825 (+3988.98%)
Mutual labels:  hacktoberfest, nuget
Sidemenu
Simple side/slide menu control for iOS, no code necessary! Lots of customization. Add it to your project in 5 minutes or less.
Stars: ✭ 5,267 (+4363.56%)
Mutual labels:  menu, menus

Blazored Menu

A JavaScript free menu library for Blazor and Razor Components applications.

Build Status

Nuget

Screenshot of component in action

Getting Setup

You can install the package via the nuget package manager just search for Blazored.Menu. You can also install via powershell using the following command.

Install-Package Blazored.Menu

Or via the dotnet CLI.

dotnet add package Blazored.Menu

Add reference to style sheet

Add the following line to the head tag of your index.html (Blazor WebAssembly App) or _Host.cshtml (Blazor Server app).

<link href="_content/Blazored.Menu/blazored-menu.css" rel="stylesheet" />

Add Imports

Add the following to your _Imports.razor

@using Blazored.Menu

Usage

Blazored Menu allows menus to be built either using markup or dynamically, using the MenuBuilder.

Building a menu with markup

You can build your menus using the following components.

  • BlazoredMenu
  • BlazoredMenuItem
  • BlazoredSubMenu

For example.

<BlazoredMenu>
  <BlazoredMenuItem>
    <NavLink href="/" Match="NavLinkMatch.All">Home</NavLink>
  </BlazoredMenuItem>
  <BlazoredSubMenu Header="Sub Menu">
        <MenuTemplate>
            <BlazoredMenuItem>
                <NavLink href="counter">Counter</NavLink>
            </BlazoredMenuItem>
        </MenuTemplate>
    </BlazoredSubMenu>
    <BlazoredMenuItem>
        <NavLink href="fetchdata">Fetch data</NavLink>
    </BlazoredMenuItem>
</BlazoredMenu>

You can also specify your own template for sub menu headers like so.

<BlazoredMenu>
  <BlazoredMenuItem>
    <NavLink href="/" Match="NavLinkMatch.All">Home</NavLink>
  </BlazoredMenuItem>
  <BlazoredSubMenu Header="Sub Menu">
        <HeaderTemplate>
            <i class="my-cool-icon-class"></i> Sub Menu
        </HeaderTemplate>
        <MenuTemplate>
            <BlazoredMenuItem>
                <NavLink href="counter">Counter</NavLink>
            </BlazoredMenuItem>
            <BlazoredMenuItem>
                <NavLink href="fetchdata">Fetch data</NavLink>
            </BlazoredMenuItem>
        </MenuTemplate>
    </BlazoredSubMenu>
</BlazoredMenu>

This feature is currently only available when building menus with markup.

You can also supply your own CSS classes to each of the 3 components

  • BlazoredMenu
  • BlazoredMenuItem
  • BlazoredSubMenu

By setting the Css parameter.

<BlazoredMenu Css="custom-menu-css">
  <BlazoredMenuItem Css="custom-menuitem-css">
    <NavLink href="/" Match="NavLinkMatch.All">Home</NavLink>
  </BlazoredMenuItem>
  <BlazoredSubMenu Header="Sub Menu" Css="custom-submenu-css">
        <HeaderTemplate>
            <i class="my-cool-icon-class"></i> Sub Menu
        </HeaderTemplate>
        <MenuTemplate>
            <BlazoredMenuItem>
                <NavLink href="counter">Counter</NavLink>
            </BlazoredMenuItem>
            <BlazoredMenuItem>
                <NavLink href="fetchdata">Fetch data</NavLink>
            </BlazoredMenuItem>
        </MenuTemplate>
    </BlazoredSubMenu>
</BlazoredMenu>

Building a menu dynamically using the MenuBuilder

If you prefer you can use the MenuBuilder to create your menus using C#. The MenuBuilder exposes two methods AddItem and AddSubMenu. You can build the same menu from the markup example as follows.

<BlazoredMenu MenuBuilder="@MenuBuilder" />

@functions {
    MenuBuilder MenuBuilder = new MenuBuilder();

    protected override void OnInit()
    {
        MenuBuilder.AddItem(1, "Home", "/")
                   .AddSubMenu(2, "Sub Menu", new MenuBuilder().AddItem(1, "Counter", "counter")
                   .AddItem(3, "FetchData", "fetchdata");
    }
}

MenuBuilder Options

When using the MenuBuilder you have a couple of extra options available via the AddItem and AddSubMenu methods.

  • IsEnabled (default: true)
  • IsVisible (default: true)

You can use these options to manipulate your menu items. IsVisible, if set to false, will mark your menu items as display: none making them invisible. Setting IsEnabled to false will render the item in a non-interactive state.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].